#1 Members - Reputation: 140
Posted 12 August 2012 - 08:24 AM
2. It seems OpenGL only has support for 8 unique lights, is there any way to add more? For instance, If I wanted a bunch of streetlights, I would run out pretty quickly.
#2 Members - Reputation: 1002
Posted 12 August 2012 - 08:32 AM
-only use those 8 lights at a time but pick the ones that affect the scene/polygon/whatever the most at the time.
-write your own shaders. If you want to do something the fixed pipeline cant or is too slow for, you need to write your own pipeline. It requires you to do all the matrix stuff and every single feature yourself though.
If you want better graphics and dont want to write your own shaders, use some existing graphics library/engine
#3 Crossbones+ - Reputation: 1443
Posted 12 August 2012 - 08:32 AM
1. If I plan on using .OBJ files for my models, do I have to learn how to calculate normals?
2. It seems OpenGL only has support for 8 unique lights, is there any way to add more? For instance, If I wanted a bunch of streetlights, I would run out pretty quickly.
1. .OBJ files support vertex normals. rather a particular file has them or not, is up to the exporter.
2. OpenGL's fixed pipeline supports n number of lights, n can be queried with glGet and GL_MAX_LIGHTS as a parameter. 8 is the minimum number of lights every implementation must support to be openGL compliant.
A common trick is to only set lights nearest to the camera as to on/off. secondly, baking lights into static models might be another avenue to take.
Edited by slicer4ever, 12 August 2012 - 08:33 AM.
#4 Members - Reputation: 3696
Posted 12 August 2012 - 09:41 AM
2. It seems OpenGL only has support for 8 unique lights, is there any way to add more? For instance, If I wanted a bunch of streetlights, I would run out pretty quickly.
The max number of lights is per vertex and pass, you can move/modify the lights whenever you want, including in the middle of rendering so you can change which X lights you want active on a per model or even per triangle basis, if your lights are static or animated you can also create static/animated lightmaps and use those for any static geometry(animated lightmaps eat up quite a bit of memory though but for things like flickering lights it might be worth it).
You can use multipass rendering and additivly blend the results together (This lets you use an unlimited number of lights even with the fixed function pipeline (just don't go too wild as each pass takes time).
The voices in my head may not be real, but they have some good ideas!






