Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Lightmapped levels, super-bright entities.

Author
Message
Kafoolwho
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location: The Deep
Posted: 4th Sep 2014 19:35 Edited at: 4th Sep 2014 20:15
Hi again.

So, I have some beautiful lightmapped levels for my game, but when adding any dynamic entity to it, it just doesn't work visually. Seeing an extremely well-lit character walking in a very dark area is rather jarring, and changing the ambient light won't fix the problem either.

My question is this: Is there a way to dynamically light a character or entity based on where they are in the lightmap, or at least a way to fake it? Any help would be very much appreciated.

PS. I am using DarkLIGHTS to lightmap the levels.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 5th Sep 2014 12:41
You could try using a point light. Something like this:



The moving sphere fades as it moves to the far left of the scene - although it gets completely dark rather abruptly. This is a limitation of the built in light commands. You can get more controllable changes in lighting using a shader - but that's more complicated. Experiment with the DBPro lighting commands first.



Powered by Free Banners
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 5th Sep 2014 12:42 Edited at: 5th Sep 2014 12:55
Hi there.

This example is not mine but I have kept it because I thought it was a good method .I do not remember who did it so I can not give credit to him and sorry for this . Attache the great example.

Cheers.

Edited
Sorry Green Gandalf. we where posting at the same time . Nice example ! . This other method use a second camera to get a 2*2 image to apply to the ball. Nice trick also

I'm not a grumpy grandpa

Attachments

Login to view attachments
Kafoolwho
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location: The Deep
Posted: 7th Sep 2014 19:35
Many thanks to both of you. Those are indeed quality examples. I have, however, decided to use the bumpbone.fx shader that comes with DarkShader on my boned entities, due to the 7 hardware lights limit. Once I figured out how to change the variables of the shader in realtime, the desired effect was achieved. I do, however, have a new problem now. If more than one character uses the shader, all entities end up using the last light source calculated. Is there any way that I can instance a shader, or change the shader settings for a specific character only?
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Sep 2014 21:38
Quote: "Is there any way that I can instance a shader, or change the shader settings for a specific character only?"


The simplest solution, if there aren't too many instances, is to load separate copies for each instance:



and apply the appropriate copy to each object. Not ideal admittedly.

A more complicated solution is to use a special texture for each object for the information you need. Since you can use different textures for each object, even using the same shader copy, you can use the texture to store all sorts of object specific information. The shaders would need to be modified slightly though. But definitely an option.



Powered by Free Banners

Login to post a reply

Server time is: 2024-04-19 11:37:45
Your offset time is: 2024-04-19 11:37:45