Jump to content

Number of dynamic lighst in level :


YouGroove
 Share

Recommended Posts

I plan to make one mesh representing a big dungeon with lot of sections for some action Rpg game.

 

How many lights can i place in the level without perfromance cost (even if it uses the deffered lightening) ?

Is there a way to specify to the engine to display only the 10 nearest lights to the player for example ?

Or do i have to manage it by code by for example deactvating/actvating only the nearest lights ?

Stop toying and make games

Link to comment
Share on other sites

Maximum number varies by hardware. Perhaps let the user decide how many lights they want active at a time. Through playing, they will find out what the best number is for them.

 

Closest 10? No, you could assign each light a "Zone ID" and each time you change zones change which lights are turned on and which are turned off. A zone could just be checking the bounds of a box.

 

If you check the distance to each light every frame, speed will suffer.

LE Version: 2.50 (Eventually)

Link to comment
Share on other sites

You could make the light dynamic.

If the framerate drops you could switch off some distant lights.

 

If the monster boss jumps out of his hideout in front of you the least worry is that some distant lights went out.

 

You could also do that as an effect. If the monsters are about to rush at you the lights will just go out.

 

Good luck aiming in the dark when too much are around hehe.

Link to comment
Share on other sites

Thanks.

I'll test with all tights to see how it runs, then if needed i will put rectangular Zone id, to avoid the mathematic formula that is expensive for caculating for each of all lights at same time.

 

(The monsters won't rush :) , it will not be full action RPG like all today hack and slash, there are enought on market, it will be different, a little like Wizadry series !)

Stop toying and make games

Link to comment
Share on other sites

It's the shadows that are expensive with point lights. Don't use shadowing with your point lights unless you need them, or simply turn them on when they are in a useful range. Combined with point of interest light sources (ones used to generate shadows or effects) you can mask the absence of shadows from every light source well. Game programming is all tricks.

 

We use dozens of the things every frame and they perform great (and these are moving).

6600 2.4G / GTX 460 280.26 / 4GB Windows 7

Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT

Tricubic Studios Ltd. ~ Combat Helo

Link to comment
Share on other sites

I wouldn't be concerned too much by the lights. The problem you will get is having a "big dungeon" represented

by just one single mesh. That will propably impact performance much more than you're lights do.

(Win7 64bit) && (i7 3770K @ 3,5ghz) && (16gb DDR3 @ 1600mhz) && (Geforce660TI)

Link to comment
Share on other sites

One must find a balance between big meshes and number of models, since a big mesh cannot be partially occluded, and the number of models causes a lot of cumulative overhead of calling the batches.

And both slow down the FPS.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

I seriously doubt you would need to do any of your own culling techniques like this. If a light is hidden behind a wall, it won't be drawn. The cost of each additional light is very low.

 

The shadow rendering optimization in LE is very advanced. There's an article here that explains how to get the most out of it:

http://www.leadwerks.com/werkspace/page/Documentation/LE2/tutorials/_/artwork/tools/indoor-lighting-optimization-r18

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Thanks guys !

I'll take care of what type of light to use, but i think all will be dynamic as i want shadows when monsters will be near one.

 

For the level i said one mesh, combined with Z Draw maximum distance if we can modify it at initialisation , i think it can be good ?

Caus yes, lot of separated meshes make lot of draw calls also !

Perhaps i'll use dungeon 3D tiles ? and i'll write a simple management system as display only meshes that are in the Cube area where the player is !

Stop toying and make games

Link to comment
Share on other sites

If possible you should make reusable "dungeon parts".

Every model that occurs more than once is instanced and you can

have a lot of them without noticeable performance impact.

(Win7 64bit) && (i7 3770K @ 3,5ghz) && (16gb DDR3 @ 1600mhz) && (Geforce660TI)

Link to comment
Share on other sites

In fact i was asking myself if welding dungeon parts within a modeler like BLender could bring some benefits like Removing unecessary vertex on welding faces.

And in terms of file loading ; a file with lot of vertex is lot more light weight than a file containing data for a big image file for example !

 

for example , if it is caves indoor, instead of making separate 3D tiles, you can make all tunnels and sort of rooms in a basic form on your modeler, and then just apply a texture on all the mesh.After that you can put big wall rocks modelsn that you duplicate , in lot of places to make all unique, wit no exactly same corridors or rooms.It's a way to avoid borring repetitive visuals.

 

I'll try to make some base level to work with within this week end , and i'll test on another PC that is not bad, but ot today PC, to see how will the level run.

Even with minimum specs needed , i target the more PC configurations possible with the engine :)

That's why i talk so much about optimisations.

Stop toying and make games

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...