[SOLVED] Shader effects parameter is not available.

Does anyone know why the BubblesTexture parameter would not be found when the effect is loaded? The Texture parameter is found ok:

Texture2D Texture;
sampler2D TextureSampler = sampler_state
{
	Texture = <Texture>;
	AddressU = Wrap;
	AddressV = Wrap;
	MipFilter = Linear;
	MinFilter = Linear;
	MagFilter = Linear;
};

Texture2D BubblesTexture;
sampler2D BubblesTextureSampler = sampler_state
{
	Texture = <BubblesTexture>;
	AddressU = Wrap;
	AddressV = Wrap;
	MipFilter = Linear;
	MinFilter = Linear;
	MagFilter = Linear;
};


(Note that I have since fixed the issue where effect.CurrentTechnique is null).

Nevermind sorted. Even though I was sampling the texture, I wasn’t using the resulting colour so it was being optimised out :smile:

2 Likes

Can you comment the code to indicate what change was made?

It would help someone coming by in future across this thread.

The code wasn’t included in what I posted; but it’s all about actually using the parameters in the shader otherwise the parameters are optimised out.

1 Like