Sign in to follow this  
  • entries
    177
  • comments
    531
  • views
    163636

Need a light?

Sign in to follow this  
Scet

80 views

Added four screenshots from Alien Vendetta for the screenshot crowd.

Today's post is about lighting. I know I went over lighting before, however my implementation sucked.

Basically what I was doing before was that when a sectors light level(0-255) changed, I looped through every vertex in the sector and changed its colour value.

My new method is to enable D3D lighting and when each subsector's render function is called, change the RenderState.AmbientColor property.

Device.RenderState.AmbientColor = Drawing.Color.FromArgb( 255, Sector.LightLevel, Sector.LightLevel, Sector.LightLevel ).ToArgb();

One call instead of what could have been hundreds, much better.



Sign in to follow this  


5 Comments


Recommended Comments

The project is really starting to take shape; soon cleaving its way from the tech-demo realm into 'omg a gaem!' land. And that's one 'omg a gaem!' land I can't wait to explore! [smile]

Share this comment


Link to comment
Quote:
Original post by Sir Sapo
Nice new avatar!


Thanks.

Quote:
Original post by HopeDagger
The project is really starting to take shape; soon cleaving its way from the tech-demo realm into 'omg a gaem!' land. And that's one 'omg a gaem!' land I can't wait to explore! [smile]


We're still a long way off, it's only just past the tech-demo stage.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now