[SOLVED] Enable additive blending

Posted By: MatAllum

[SOLVED] Enable additive blending - 11/15/14 22:55

Edit: Fixed the problem below. Now wondering how to enable additive blending via shader, as setting BRIGHT no longer works when I apply the shader.

I have the distinct feeling I'm leaving something out, but my shader is definitely not working as intended. For now it's a very simple deal; save on texture space by mirroring a symmetrical health bar. The model is properly mapped outside the regular texture coordinates. But I'm not seeing any effect by using AddressU or AddressV:

Code:
texture entSkin1;
sampler basemap = sampler_state
{
	texture=(entSkin1);
AddressU = Mirror;
AddressV = Mirror;
};



Clamp would also be nice to get working, but not entirely necessary. Am I leaving something important out here?
Posted By: sivan

Re: Texture address clamp/mirror not working - 11/15/14 23:12

wrong brackets?

it works for me

Code:
sampler tileSampler1 = sampler_state 
{ 
   Texture = <entSkin2>; 
   MinFilter = Linear;
	MagFilter = Linear;
	MipFilter = Linear;
	AddressU = mirror;
	AddressV = mirror;
};

Posted By: MatAllum

Re: Texture address clamp/mirror not working - 11/15/14 23:51

OH MY GOD.

I also forgot to apply the material to the model.
That said, thank you for giving me the correct syntax. laugh

New question related to the same concept: how do you enable additive blending in the shader? The model BRIGHT flag is set but by applying the new shader, it just sits there fully opaque.
Posted By: Kartoffel

Re: Texture address clamp/mirror not working - 11/16/14 11:07

brackets don't even matter.. at least I sometimes forget them and everything works fine.
Posted By: sivan

Re: Texture address clamp/mirror not working - 11/16/14 15:40

instead of multiplying colours and lights, use addition to get additive blending
Posted By: Kartoffel

Re: Texture address clamp/mirror not working - 11/16/14 18:09

you have to set ScrBlend and DestBlend in the pass to some special values.

(maybe ScrBlend = ScrAlpha and DestBlend = One... but I don't know)
Posted By: MatAllum

Re: Texture address clamp/mirror not working - 11/16/14 18:38

Thanks guys, I got it set up correctly now. laugh
© 2024 lite-C Forums