Results 1 to 2 of 2

Thread: Debugging a shader

  1. #1
    Join Date
    Jan 2009
    Posts
    2

    Default Debugging a shader

    Hiya everyone

    I've just tried to get my first basic phong shader running in XNA. It's identical to the example in Tutorial 1, except I've added two more lights to the scene as I'd like to mimic XNA's BasicEffect.

    I'm getting the following error during compile:

    Code:
    error X3017: 'Light_directional_main': cannot implicitly convert from 'float4' to 'struct{13}'
    Here's the lines throwing the error:

    Code:
    float4 msl_Light_directional_1_result;
    	float4 msl_Light_directional_1_light_shadow;
    	Light_directional_main(msl_Light_directional_1_color, msl_Light_directional_1_intensity, msl_Light_directional_1_result, msl_Light_directional_1_light_shadow);
    And here's the method it's referencing:

    Code:
    void Light_directional_main(
    	inout State state,
    	float4 msl_color,
    	float msl_intensity,
    	out float4 msl_result,
    	out float4 msl_light_shadow)
    {
    	{
    		msl_result = (msl_color * msl_intensity);
    		msl_light_shadow = (float4(1,1,1,1));
    	}
    }
    I'm only just beginning to get my head around HLSL and I'm not sure what Struct{13} is yet. Can anyone help explain or fix this?

  2. #2
    Join Date
    Jun 2007
    Location
    Berlin
    Posts
    447

    Default

    Hi,

    this looks indeed interesting... Especially because I can't see a struct anywhere. Did you just export a plain Phong shader?
    Please let us know which mental mill version you are using so that we can track down that error. We are starting to look into XNA shader export so that the shaders fit smoothly into the XNA pipeline. So far we don't have a dedicated HLSL export to XNA so this might be the reason.

    If you provide the .xmsl scene that contains your shader (network) we'd be happy to look into it and give you futher support.

    Best Regards,
    Ruediger

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •