Jump to content
  • Advertisement
Sign in to follow this  
Uriel

HLSL - vs with fixed pipe texture problem

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

Hello again ;-) Im trying to force my app to run on some old hardware without ps. All i need is to use my vertex shader and render model with texture. I create effect file with only vertex shader - all works ok. struct VS_OUTPUT { float4 Pos : POSITION; float2 Tex0 : TEXCOORD0; }; VS_OUTPUT VShade(VS_INPUT In) { VS_OUTPUT Out = (VS_OUTPUT) 0; Out.Pos = In.Pos; Out.Tex0 = In.Tex0; return Out; } And i get black model. Texture is set this way: effect->SetTexture("Texture1",tex); What could go wrong? Should i set some render extra states to make fixed pipe texture my models? I tried ColorArg0[0] = DIFFUSE; but with no effect... any ideas?

Share this post


Link to post
Share on other sites
Advertisement
Hello Armadon!

Thanks but i dont want to use ps - i want to use vs with fixed pipeline. I want this to run on hardware that doesnt support ps at all - only vs_1_1.. any other ideas?

Share this post


Link to post
Share on other sites
Thanks vNistelrooy, but that was not the case.. i was able to figure out whats wrong - when i set texture in the effect i cant specify stage, like i do when setting it with device (lpD3DDevice->SetTexture(0,tex) )
Texture set with effect has random stage - how can i avoid this? Is there a method of forcing effect file to load specific texture to specific stage?

[edit]

Nope, i was wrong - still doesnt work. It was rendered textured because there was pixel shader loaded from previous model.
No one ever tried to use vertexshader without ixel shader and render a textured model?

[Edited by - Uriel on August 15, 2005 6:52:14 AM]

Share this post


Link to post
Share on other sites
In your effect file set pixel shader to null, forcing usage of fixed pipeline:
technique MyTechnique
{
pass P0
{
vertexshader = compile vs_1_1 VShade();
pixelshader = NULL;
}
}


Also, when you set texture with effect interface (using whatever name, like "Texture1"), you got to have a texture variable withing the effect with that name. Then you can use it with pixel shader.
To use fixed pipeline, use standard pDevice->SetTexture(stage, pTex);

Well, I'm relatively new to shaders, so hope I'm right ;)
~def

Share this post


Link to post
Share on other sites
You are right, but it still doesnt work. I set texture usig device way, i set ps to null, and i get black model.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!