Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

unable to compile shader for opengl profile with textureCubeLod (texCUBElod on d3d9)

Discussion in 'Shaders' started by sebastien lagarde, Feb 21, 2011.

  1. sebastien lagarde

    sebastien lagarde

    Joined:
    Jul 22, 2010
    Posts:
    15
    hello, I compile a shader for the following profile: #pragma only_renderers d3d9 gles opengl

    for D3D and gles, I use texCUBElod without problem in my shader, but texCUBElod is not recognize
    by opengl compiler. I switch to textureCubeLod and this should be ok, BUT
    the compiler complain this time with error:

    Program 'frag', function "texCUBE" not supported in this profile at line 152

    however I have no texCUBE at all in the code. textureCubeLod is well recognized, cause I get an error on it if I put
    the wrong number of argument.

    It's behave like if there was a define like #define textureCubeLod texCUBE
    so I try several #undef but nothing work

    sample of my shader code:

    #ifdef SHADER_API_OPENGL
    float3 ReflectionColorCube = textureCubeLod(_ReflectionColorCube, reflectViewDirWS, 1).rgb;
    #else
    float3 ReflectionColorCube = texCUBElod(_ReflectionColorCube, float4(reflectViewDirWS, 1)).rgb;
    #endif

    any help would be appreciated.

    thanks
     
  2. God-at-play

    God-at-play

    Joined:
    Nov 3, 2006
    Posts:
    330