Sign in to follow this  
VytsL

need help with ID3DXEffect

Recommended Posts

Hi guys, I am beginner and trying to work with HLSL, but have this problem: hr = mGrassLod1Effect->BeginPass( p ); getDevice().SetTexture( 0, 0 ); assert( mGrassVertexBuffer ); getDevice().SetStreamSource( 0, mGrassVertexBuffer, 0, sizeof ( GrassVertexType ) ); assert( mGrassIndexBuffer ); getDevice().SetIndices( mGrassIndexBuffer ); getDevice().SetFVF( GrassVertexType::FVF ); hr = getDevice().DrawIndexedPrimitive( D3DPT_TRIANGLELIST, 0, 0, mGrassVertices.size(), 0, mGrassIndices.size() / 3 ); hr = mGrassLod1Effect->EndPass(); No matter that are contents of Vertex Shader, I see same results. It looks like vertices don't come to VS (and go thru Fixed). I select Technique prior to pass loop, handle all errors etc (omitted it) Here is info I consider might be useful: 1. GrassVertexType::FVF is D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE; 2. Here are VS inputs and outputs: struct VS_OUTPUT { float4 Position : POSITION; // vertex position float4 Diffuse : COLOR0; // vertex diffuse color }; VS_OUTPUT Vertex_Shader_Transform ( float3 vPosition : POSITION, float3 vNormal : NORMAL, float4 vColor : COLOR0 ) 3. It looks like .fx file gets compiled, cause if I enter some nonsense into it it is not compiled. Also, if I try to set not existing global in VS etc it fails too. So .fx is created and compiled ok, but I can't animate anything. Please, help! Vytautas

Share this post


Link to post
Share on other sites
I am using GeForce MX 4 integrated video, I know it has no HW VS or PS, but I hope that software vertex processing is still available, am I right?

I suspect that problem might be with some D3DDevice or VertexBuffer flags. Is it possible that some of flags can cause behaviour I mentioned above?

Thanks!
Vytautas

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this