Jump to content
  • Advertisement
Sign in to follow this  
Freakdesign

Mesh darkens when scaling bigger

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

Hi all in my actual gameproject i stumbled in a strange Problem: say i create a mesh and render it without any modifications. I get what i exepected: my mesh with colors and textures and all material options (like transparency). now i scale this mesh bigger and bigger see what i get: Screenie you see the mesh darkens until it is black as the big black hole in the middle of the milkyway. where is the trick? why darkens my mesh, or is it a bug? ;) thx for any answer.... Freakdesign

Share this post


Link to post
Share on other sites
Advertisement
Hello,

This looks like a case of normals getting scaled. Try setting de D3DRS_NORMALIZENORMALS render state to TRUE.

Share this post


Link to post
Share on other sites
Great! it works perfectly.
thats it!
Thx for the fast help Aldenar.

i setted it in the beginscene() - endscene() sequence. it seems to slow my engine a bit. is it performance expensive?
i guess i need a table of all renderstates with their costs to speed ;)

Share this post


Link to post
Share on other sites
Yeah, there is an extra cost when using this render state. Actually, what it does is it re-normalize all normals that are transformed. This is mandatory when your world transform has scaling in it, but you don't need it when rotations and translations only are applied. I think it may be good to turn it on only when rendering a scaled object so you won't decrease the speed of the entire rendering process.

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!