not getting this texture blending.. help

Started by
4 comments, last by AlexM 24 years, 5 months ago
What 3D card do you have?
Advertisement
nVidia ZX 8 mgs
i just got smart and looked up my hardware caps, as you suggested. i guess from the looks of it my HAL can't do blending (allows max 1 arg). Does that mean i can't do transperancies either? it's all because of my video card, right?
Thanks for replying.
Yeah, Riva128's only have a single texture blending stage.

You can still achieve the same effect, but you'll have to use multipass blending.

Essentially, draw the first texture, normal.

Then enable alpha blending, and set source and dest blend to 1. This will set the alpha blending to be "Final = Source + Dest"

Draw the polygon with the second texture.

The obvious drawback of this is that the Riva128 has a substantially lower fill-rate than a two-stage card, like the Voodoo 2 or 3 and the TNT 1 and 2, but we're asking it to draw twice as much.

i'm trying to blend two textures like this:
//first texture
lpd3ddev->SetTextureStageState(0,D3DTSS_COLOROP,D3DTOP_SELECTARG1 );
lpd3ddev->SetTextureStageState(0,D3DTSS_COLORARG1, D3DTA_TEXTURE );
//second texture
lpd3ddev->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_ADD );
lpd3ddev->SetTextureStageState(1, D3DTSS_COLORARG1, D3DTA_TEXTURE );
lpd3ddev->SetTextureStageState(1, D3DTSS_COLORARG2, D3DTA_CURRENT );

The textures are all set up and all of that stuff. my understanding is that the above should simply add the two textures. but, i'm just getting the first texture component. Also, are the stages supposed to control the diffuse and specular lighting or just emphasize them? i mean, if i don't include the lighting components into the blending, will lighting still occur? Oh, and do the lighting components in blending use the vertex color in the vertex structure or the one calculated by auto lighting?
Thanks in advance.
Alex

you can still do transparencies with an alpha channel in your textures. Or just set the color key to your transparent color.
(pink or black are usually used)

This topic is closed to new replies.

Advertisement