Joined: 24 Sep 2005
Location: Raleigh, NC
|Posted: Mon Nov 16, 2009 5:49 pm Post subject: Re: Dynamic Lighting
Dan I was wondering how you implement this with a shader
I know its an older but a goodie.
Yuo don't have a simple example of this I could modify and play with do you?
or even something newer?
Hey, I actually still use the same system for some dynamic lights in my game, it's faked in two dimensions by 'projecting' a light texture down on the scene. The code to create most parts is pasted there [ I forgot I made that post spilling the beans lol ] ... it's very simple if you use HLSL, the old ASM code is a bit hard to follow I'd imagine. I can't beleive I used to code an entire graphics engine in ASM shaders
Is there any particular aspect you have a question about? The texture can be generated by RenderToTexture then you add a few lines to your scene's output shader. I can help you understand it if you can point to where you get confused in the original description ... it's very limited anyways, and it only really good for flat surfaces like terrain, or a city's streets. Also I just looked at the HLSL code it's quite a hacked up mess this whole algorithm is, it's hard to explain all the little things I do, also it is coded with constants that fit the lighting to my world size, etc. So the code would probably be more confusing, it'd be better to get the idea conceptually.
I run this place.
"Some muckety-muck architecture magazine was interviewing Will Wright about SimCity, and they asked
him a question something like "which ontological urban paridigm most influenced your design of the simulator,
the Exo-Hamiltonian Pattern Language Movement, or the Intra-Urban Deconstructionist Sub-Culture Hypothesis?"
He replied, "I just kind of optimized for game play."