2 Replies Latest reply: Sep 26, 2011 11:54 AM by AIF Bob RSS

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

    m_icy

      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,uLightingDirection),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.