Jump to content
  • Advertisement
Sign in to follow this  

Fixed function texturing help

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

I know how to do this with shaders, but I can't figure out how to set up all the render states and texture stages to get this working with the fixed function pipeline. What I want to do is apply a diffuse colour to vertices using an alpha mask from a texture file. This is what I have, but it doesn't work.
	d3d_device->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
	d3d_device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
	d3d_device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);

	d3d_device->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
	d3d_device->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
	
	d3d_device->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
	d3d_device->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_DIFFUSE);

Thanks s.

Share this post


Link to post
Share on other sites
Advertisement
Lets just hope ntnbet picks up on this thread - he's usually pretty hot on the fixed function texture cascade [cool]

I'm pretty sure you need to get a D3DTOP_MODULATE (or D3DTOP_PREMODULATE) in there somewhere. Maybe even:

D3DTSS_COLOROP = D3DTOP_MODULATE
D3DTSS_COLORARG1 = D3DTA_DIFFUSE
D3DTSS_COLORARG2 = D3DTA_TEXTURE


??

Writing these out on paper always helped me prior to ditching FF effects.

hth
Jack

Share this post


Link to post
Share on other sites
Quote:
Original post by jollyjeffers
Lets just hope ntnbet picks up on this thread - he's usually pretty hot on the fixed function texture cascade [cool]
I'm struggling with the idea that someone who knows shaders is voluntarily adding fixed pipeline support. Unless a publisher makes you do it, stay away! Once the GeForce4MX and GeForceFX series are considered completely outdated, we can finally rejoice in pure shader glory. (Seriously, we just added fixed pipe support to a game because the FX series cards pixel shaders are way too slow).

Share this post


Link to post
Share on other sites
I totally agree, I hate fixed function. I'm just making a game where the minimum spec is my brothers computer. Unfortunately he has some ancient video card with no shader support.

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!