So I referenced the OTK file instead of agateDraw and lights work fine (The MDX version won't work for me). But I don't get how to use them because I know 0% physics. How can I make something similiar to a spot light? Like a small round light about 200 px wide (something akin to carrying a torch in a dungeon) How can I use lights to make better explosion effects? I've been playing with values but it seems like no matter what I do the lights overpower the background. I don't know if I described that right, but, what I'd like to be able to do is have a small "bright spot" without altering the light of the rest of the scene. Also, is there a way to apply a light to a single surface or sprite? Do you know what the upper bound of light sources is? I remember in the 90s it was like.... 7. I'm assuming it's in the hundreds now? |
|||
|
|

I forgot to mention, Agate
I forgot to mention, Agate uses per-vertex lighting, so if you are lighting large surfaces you may have problems where the lighting only has an effect if it's near the corner. If this is the case then you need to turn up the surface's TesselateFactor. This cuts a large surface into several small surfaces for drawing. There is a performance cost with turning this up, so only do it where needed.
Yeah, so lighting you kind of
Yeah, so lighting you kind of have to play with the parameters, and the results can be quite sensitive to what seem like small changes in the parameters. The defaults are AttenuationConstant = 0.01, AttenuationLinear = 0, and AttenuationQuadratic = 0.00001. This will create a spotlight type effect that is about 50 pixels in diameter. You can make this larger by reducing the quadratic attenuation to say 5e-7f. The attenuation formula goes something like 1/(a + b*r + c*r^2) where r is the distance from the light and a, b, c are the constant, linear and quadratic attenuation parameters, respectively.
You can apply a light to a single object by doing lights.DoLighting, drawing the object(s) you want the light applied to, and then call Display.DisableLighting. The downside to this is if lighting is disabled, then everything will be as bright as possible. An alternative approach would be to have two LightManager objects and have one just have some medium ambient lighting and use that for rendering everything, and then turn on your one light for the few objects that need it.
The upper bound on light sources really hasn't changed, it seems like it's still stuck at 8. I don't really know why it hasn't been improved, maybe because they expect shaders to take the place of lights.