Skip navigation
m_icy
Currently Being Moderated

i want to make sure that "if" is work fine in pixelblender3d

Jun 27, 2011 10:18 PM

as the title:

it seems it not work.

 

<languageVersion : 1.0;>
material kernel phong
<
    namespace : "AIF Test";
    vendor : "Adobe";
    version : 1;
>
{
    parameter float3 uNMatrixPart_A;
    parameter float3 uNMatrixPart_B;
    parameter float3 uNMatrixPart_C;
    parameter float3 uAmbientColor;   
    parameter bool uUseLighting;
    parameter float3 uLightingDirection;   
    parameter float3 uDirectionalColor;   
    input vertex float3 aVertexNormal;
   
    input image4 inputImage;
    input vertex float4 vertexUV
    <
        id: "PB3D_TEXTURE_COORDS";
    >;

 

    // Interpolated.
    interpolated float4 interpolatedUV;
    interpolated float4 vLightWeighting;

 

    // Output.
    output float4 result;
   
    void evaluateVertex()
    {
        interpolatedUV = vertexUV;
        if(uUseLighting){
            float3x3 uNMatrix=float3x3(uNMatrixPart_A,uNMatrixPart_B,uNMatrixPart_C);
            float3 transformedNormal = aVertexNormal*uNMatrix;
           
            float directionalLightWeighting=max(dot(transformedNormal,uLightingDirectio n),0.0);
            float3 tmpWeigth=uAmbientColor + uDirectionalColor*directionalLightWeighting;
            vLightWeighting=float4(tmpWeigth.r,tmpWeigth.g,tmpWeigth.b,1.0);
        }else{
            vLightWeighting=float4(1.0,1.0,1.0,1.0);
        }
    }

 

    void evaluateFragment()
    {
        float4 textureColor = sample(inputImage, float2(interpolatedUV.x, interpolatedUV.y));
        float4 tmpColor=textureColor*vLightWeighting;
        result=float4(tmpColor.r,tmpColor.g,tmpColor.b,textureColor.a);
    }
}

 

The error is : "TypeError: Error #1034: 强制转换类型失败:无法将 com.adobe.pixelBender3D.asm::IfBlock@2273b01 转换为 com.adobe.pixelBender3D.asm.BasicBlock。"

 

and i need a solution to this.

 
Replies
  • Currently Being Moderated
    Jun 29, 2011 4:42 PM   in reply to m_icy

    I'm not sure what's going on here but I'll log it as a bug and we'll look into it.

     

    Bob

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 26, 2011 11:54 AM   in reply to AIF Bob

    This problem has been fixed in preview 3 of Pixel Bender 3D

     

    Bob

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points