Implementing lighting in my OpenGL engine
I'm currently writing an ongoing OpenGL graphics engine for educational purposes. I've had some experience with OpenGL in the past. But I have some questions.
Eventually for my engine I want to have per-pixel lighting and dynamic soft-shadows (only for point lights, with max 2-3 rendered at a time). But first I need to implement per-vertex lighting. My question is, to do this do I use OpenGL's default lighting functions? Or do I write all of the lighting from scratch? In prior experience with OpenGL lighting I found that the system was entirely messed up. IE the limiting distance of the point lights never worked.
Can anyone point me in the right direction to start getting lighting implemented into my engine?
Thanks
Visit http://ati.amd.com/developer/index.html
download rendermonkey. It has some GLSL demoes for PPL and per vertex lighting.
download rendermonkey. It has some GLSL demoes for PPL and per vertex lighting.
Quote:Original post by c_olinGenerally, this isn't a good idea. Standard GL light functions nowadays simply wrap to updating some special uniforms... you may have heard that fixed function pipe is dead: don't use it.
My question is, to do this do I use OpenGL's default lighting functions?
You're going to use shaders anyway sooner or later.
Quote:Original post by c_olinThe shader lib from NV is possibly the most extensive free reference here. Programming vertex and pixel shaders by Engel features a few different lighting models. It's a nice way to keep this info organized.
Can anyone point me in the right direction to start getting lighting implemented into my engine?
Once the math behind is clear, it just takes to design the uniform layout and stuff like that... something that it's really proprietary to your system.
Yes, OpenGL lighting is more or less obsolete, but if you want some quick results without touching any shader stuff - why not. If you want to combine it with more effects and shadowmaps - reimplement properly with shaders.
Yes, it's subjective. I never liked standard GL functions in the first place so I started from a biased position. :)
There are places in which quick prototyping helps... I don't think this is one.
There are places in which quick prototyping helps... I don't think this is one.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement