pass variable

Started by
21 comments, last by Claudio 15 years, 3 months ago
Quote:Original post by Namethatnobodyelsetook
I've never used ApplyParameterBlock, so you can probably safely ignore that call.


When I run the application, I can see (in a part of Visual Studio C++ .Net) the messagge "ApplyParameterBlock failed". The apllication run but don't change the color of the 3D object in function directly of the share variable.
Advertisement
Quote:Original post by Namethatnobodyelsetook
Is the technique you're attempting to use valid on your graphics card?


The technique are: "perPixel", "perVertex" e "vertexOnly":

technique perPixel{	pass single	{		stateblock = <commonState>;		VertexShader = compile vs_1_1 PerPixelVS(world,view,proj);		PixelShader  = compile ps_2_0 PerPixelPS(positionProbeLeftHand);	}}technique perVertex{    pass single    {    	stateblock = <commonState>;		VertexShader = compile vs_1_1 PerVertexVS(world,view,proj, positionProbeLeftHand);		PixelShader  = compile ps_1_1 PerVertexPS();    }}technique vertexOnly{	pass single   {   stateblock = <commonState>;	VertexShader = compile vs_1_1 PerVertexVS(world,view,proj, positionProbeLeftHand);	PixelShader  = null;   }}


as the same that I use in the code. And I've only one "pass" ("pass single") fr each technique.
Quote:Original post by Namethatnobodyelsetook

Quote:If I use only one effect with three technique, as in the code you have written, I set the share variable for the techinque A to 1.0f, B to 2.0f and C to 3.0f and not A, B and C to 3.0f ???

This was to demonstrate that if the variable is used across techniques, the value is global, and not specific to one technique. You can't just set a value per technique during initialization, you need to update the variable as you are rendering each object.


So, I prefer to work with three effects, where each have only one technique, and not with one effect with three technique inside.

This topic is closed to new replies.

Advertisement