Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

bastep

Actor Lighting

This topic is 6173 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

The little rollerblading greenies in the playground demo are not susceptible for the different brightness conditions in the level. They stay the same all the time. This, of course, is impossible for a modern game. By dabbling with the parameter of the PR_SetLightStrength in the file play.c, however, we have been able to change the behaviour of the weapon actor. After the change, the weapon changed it''s shading nicely. QUESTION What flags have to be set, what commands have to be inserted to make characters and enemies adapt to the surrounding brightness? How do I find out what brightness is present at acertain coordinate in my world?

Share this post


Link to post
Share on other sites
Advertisement
A common way with lightmaps is to trace a ray downwards from the character to find the closest face and lightmap. You can then look up the lightmap value for brightness/color.



Share this post


Link to post
Share on other sites
Now, is it possible to shade the green goblins according to surrounding light? That''d be nice to know.

Colin

Share this post


Link to post
Share on other sites
To do that you''ll need to store a list of lights for the level and set up the 8 closest ones in the PR light list before each character is drawn.

So yes it is possible, but it''s not part of the example code. For the goblin character you''ll also need to make a custom vertex shader that handles point lights in addition to the directional light already coded.


Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!