Showing posts from 2011

Screen-Space Directional Occlusion

Now I have the screen-space directional occlusion working well, here's a pic :) The model I found in the standard Max scenes, I wanted some better geometry to test the lighting than my crappy programmer art. The scene has just one diffuse shadow-casting spotlight, and the SSDO provides all the rest of the colour, using the environment cube. Note the orange shining on the sides of the crazy model, with occlusion occuring in its upper fins. And the same model, with a different environment. This is going to look great when weather changes roll in, or during sunsets around planets, or going into nebulae out in space..

Screen-Space Ambient

Currently, I'm still doing a lot of this using multiple forward-rendering geometry passes, when they could instead be using screen-space techniques. I have done this so far as the performance for what I'm trying is fine, and it aids debugging greatly to be able to easily turn off entire passes. However since the lighting was added in, with arbitrary numbers of lights (5 shadow-mapped lights now being used), then engine has slowed down greatly. Time to revisit the render channels. Ambient Lighting is an obvious task here. Currently, I draw the depth/normals map, create the ambient cube map, calculate SSDO, and then - using forward-pass geometry - draw the ambient lighting into the scene, looking up SSDO and the ambient cube map. However the screen-space data is all there ready to be used - screen space normals and SSDO. Additionally, the screen-space fogging that fades the scene out to the ambient cube map is almost identical to what I want to do. So hell, let's do i

Optimising the procedural scene generator

First of all, its crazy doing procedural scene generation and the scene graph in Python. When you're dealing with 1000's of tiles, c++ is a far better match. However, in keeping with the spirit of things, let's try and optimise the Python procedural scene first, as any high-level optimisations done are still likely to be beneficial after porting (and easier to prototype in Python!) Step 1 in any optimisation is profiling, to see where we need to optimise. Here's a snippet from my results ================================ BEFORE - 47% in RenderChannelStrip.render ================================ ncalls tottime percall cumtime percall filename:lineno(function) 3731 23.980 0.006 23.980 0.006 K:\Pegwars\current\Scripts\PyStingray\ 44150 2.884 0.000 2.884 0.000 d:\Pegwars\current\Scripts\Scene\ 287 2.862 0.010 3.243 0.011 d:\Pegwars\current\Scripts\Frustum\FarPlane.

Pegwars in Darwin..

Been a while since the last Pegwars effort, since then I've packed up shop and moved to Darwin! Also since then I've been getting into Android programming. One of my Android apps involves porting some of the Stingray engine to Java and OpenGL, which was FUN. However since dry season hit, and my cool 3D rain app can no longer be worked on (no way to test it lol) I've moved back onto Pegwars programming. First step was reading my codebase and understanding it again. To do this, I followed through my DogFight and SpaceFlight python modules, and drilled down into the how the Scene works, with n cameras and lights and render channels and Scene vizCallbacks etc. Very happy once I'd figured it out, to remember that I had come a long way. With hindsight and a fresh perspective, I jumped in and fixed a few long-standing bugs. Then to test out my knowledge of the renderer, I launched in and implemented both depth-of-field scene blurring and materials that reflect the dyna

One year on..

Wooahh, one year on, and to think I was just really gaining momentum.. Guess moving to a different city and the upswell of the Android app store and promise of $$$ is a fair enough distraction. So today marks the occasion where I've taken up Pegwars again, and with the awesome benefit of a huge pause and the hindsight that affords, I fixed 3 long-standing bugs that were sucking the gumption out of me 1. The python console that every so often went haywire is fixed. Solid. 2. The blooming that flickered in and out annoying, fixed. Solid. 3. Can now fly between solar systems without the weird rendering issue; Spaceflight App module now cleans its solar system up properly. This unlocks the door to the entire Pegwars game I've come to this fresh now and am really happy with the progress I made. There were some gumption traps present in some bugs, but the design is solid and I feel on the cusp of some pretty fast progress now.