Jump to content
  • Advertisement
Sign in to follow this  
s3mt3x

OpenGL Direct3D disabling textures

This topic is 4082 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 Guys, Hopefully the easy title got you looking at this. Anyway - I want to be able to disable texturing in my D3D app and then draw my primatives (which have position and texture verticies) using the color stored in the material on the device - I know this sounds backwards, but I have my reasons (see below). Lighting must be disabled too - anyone have any ideas? I'll explain the reasons below for those who are interested. I'm porting my application over from opengl - my app is kind of like a modelling app and uses a lot of picking. In opengl I found the easyist way to implement this was to render my objects with a different color to the back buffer, read the pixel back under the mouse and translate this back to the object drawn. The other benefit of this was the ability to select a rectangle on screen, read back all the pixels in that rectangle and add the appropriate objects to the selection stack. I want to acheive the same in D3D and i'm not too sure where to start. I've managed to read back pixels but I can't seem to set the color for textured primatives and I want to avoid the overhead of recreating each primative with color values stored in the vertex - any help would be really appreciated. I'm well aware of ray based picking, but given what I want to acheive (i.e. with the ractangle selection) I think this should be my best bet (providing it's possible of course). Any suggestions? Thanks for any help, Chris.

Share this post


Link to post
Share on other sites
Advertisement
I'm assuming that you're not using pixel shaders, and haven't even looked at texture stages. Though shaders are the standard way to go these days, texture stages can still be easy to start with. Read about them in the DX docs (look at SetTextureStageState). Basically, you'd want to set the texture factor render state (D3DRS_TEXTUREFACTOR), and select that as the argument of your only texture stage.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!