Jump to content
  • Advertisement
Sign in to follow this  
browny

few questions on DX --

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

Following are my questions 1. Is there any way to turn off texturing globally, something similar to glDisable(GL_TEXTURE_2D). Basically im asking if theres any function like mDevice->SetRenderState( D3DRS_LIGHTING , FALSE ) for textures? 2. Does DirectX have something similar to GL_COLOR_MATERIAL. If a vertex stream has color component in it and if lighting is enabled.. will those color component be used in the lighting calculation without any D3DMATERIAL9 being set ? Z

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by browny
Following are my questions

1. Is there any way to turn off texturing globally, something similar to glDisable(GL_TEXTURE_2D). Basically im asking if theres any function like mDevice->SetRenderState( D3DRS_LIGHTING , FALSE ) for textures?

2. Does DirectX have something similar to GL_COLOR_MATERIAL. If a vertex stream has color component in it and if lighting is enabled.. will those color component be used in the lighting calculation without any D3DMATERIAL9 being set ?

Z


1. Not as far as I know.

2. Set D3DRS_COLORVERTEX to true. Then D3DRS_*MATERIALSOURCE (*=DIFFUSE, SPECULAR, AMBIENT, EMISSIVE) can be used to set if the color comes from material, vertex diffuse, or vertex specular.

Share this post


Link to post
Share on other sites
Quote:

1. Not as far as I know.


Hmm.. so how do i turn texturing off globally ? Do i have to set NULL to all the texture stages.. like running a loop everytime ?

Share this post


Link to post
Share on other sites
Quote:
Original post by browny
Quote:

1. Not as far as I know.


Hmm.. so how do i turn texturing off globally ? Do i have to set NULL to all the texture stages.. like running a loop everytime ?
Passing NULL to all the texture stages that are in use is pretty much the only way, yes.

I hope you're not trying to make a D3D device behave like an OpenGL one, because you're likely to run into all sorts of problems by doing it this way.

Share this post


Link to post
Share on other sites
Actually i am working on a big project which requires the renderer module to be converted from OpenGL to DirectX. So ya, i know these two APIs are entirely different but due the architecture that had already been laid out, i am trying to keep things as closely as possible.

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.

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!