Skip to main content
GameDev.net gamedev.net
🔒 Locked

Texture setting

Started by The C modest god Feb 21, 2005 at 12:35 PM 3 replies 400+ views
Original Post
The C modest god
The C modest god
What does the following lines of code do?

        pD3DDevice->SetTextureStageState( 0, D3DTSS_COLOROP,   D3DTOP_MODULATE );
        pD3DDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
        pD3DDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE );
        pD3DDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP,   D3DTOP_DISABLE );
It's all about the wheel.Never blindly trust technoligy.I love my internal organs.Real men don't shower. Quote: Original post by Toolmaker Quote:
Evil Steve
Evil Steve
It causes the colour generated to be texture * diffuse, and disable alpha. Texture * diffuse is the default for stage 0 anyway, so it does nothing except disable alpha - unless the texture stage has already been changed.
DrunkenHyena
DrunkenHyena
Quote:
Original post by Evil Steve
It causes the colour generated to be texture * diffuse, and disable alpha. Texture * diffuse is the default for stage 0 anyway, so it does nothing except disable alpha - unless the texture stage has already been changed.


Not that explicitly stating what you want is a bad thing. Never rely on the defaults, so if that's what you want, that is what you should set.

As a side-note, setting alpha to DISABLE in an active stage is illegal. Don't do it.
Stay Casual,KenDrunken Hyena</FON
Evil Steve
Evil Steve
Quote:
Original post by DrunkenHyena
Quote:
Original post by Evil Steve
It causes the colour generated to be texture * diffuse, and disable alpha. Texture * diffuse is the default for stage 0 anyway, so it does nothing except disable alpha - unless the texture stage has already been changed.


Not that explicitly stating what you want is a bad thing. Never rely on the defaults, so if that's what you want, that is what you should set.
True. However, it doesn't really make sense for the default to be anything else in this case.
DrunkenHyena
DrunkenHyena
Quote:
Original post by Evil Steve
True. However, it doesn't really make sense for the default to be anything else in this case.

If you rely on the drivers to always be right, you're in big trouble. And yes, I've run into cases where drivers were NOT setting these to the defaults. Things are better, but even if it only happens once it can cause you a lot of grief. So considering how little effort it takes to set those states yourself, why wouldn't you?
Stay Casual,KenDrunken Hyena</FON

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.