Jump to content
  • Advertisement
Sign in to follow this  
Metus

Managing a scene

This topic is 5414 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Greetings Earthlings - I Come in Peace -------------------------------------- Ehhrrmmm.. yeah whatever... I've got a simple question to all the experienced game programmers here: How do I manage Light-objects in a scene? My engine hierarchy looks a little like this: * create the current scene * register meshes into the scene * register lights into the scene * update the scene-meshes (transformation, animation and rotation) * update the lights (some problems here yes...) * render the scene meshes My problem, or question, is that since the fixed pipeline only can handle 8 lights simultaneously, but the scene can contain more than 8 lights, should i only disable the lights that isn't needed or the lights with the least significance?

Share this post


Link to post
Share on other sites
Advertisement
Both. Only enable the lights needed for the particular mesh you're rendering. The less lights you have enabled, the better performance you'll get, so you only want to use what will make a noticable difference on the screen.

Share this post


Link to post
Share on other sites
You can actually get away with using lightmaps for some of the more specific lighting, and you can get some... interesting effects if you use fog correctly.

You should never need more than 8 lights active at once. There's no reason why an object should be within 8 lights - you should definitely disable the ones with the least effect (most likely the furthest, but depends on light intensity and range).

What are you doing that has more than 8 lights anyway?

Share this post


Link to post
Share on other sites
Quote:
Original post by Metus
I haven't any specific scen, i just had some thought what if the scene had 8+ active scenes...
You mean lights

Anyway, then you determine most important lights or combine more into one. Also, not all lights cast shadows. Some can be used as ambient.

Share this post


Link to post
Share on other sites
A easy way is to only enable a limited X number of lights(The lowerend hardware could use 1-2). Then for every mesh, change the settings of the lights to that of the nearest X lights and render.

So while you scene might have a long hallway with hundred light sources, you only pass the settings(position/color/brightness/etc..) of the nearest X lights for each mesh.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!