Sign in to follow this  
browny

few questions on DX --

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
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

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

Sign in to follow this