Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Error C5025: lvalue in assignment too complex

  1. #1
    Intern Newbie
    Join Date
    Feb 2014
    Posts
    38

    Error C5025: lvalue in assignment too complex

    I'm struggling with this error occuring in assignment array indices. Internet has given few different solutions that didn't really work.

    Error's name would suggest that the expression in index braces is too complex, but I doubt it is in this line:
    Code :
    outFrag.LightDir_tan[i] = normalize(lightDir);

    As i experimented around the array itself, I noticed this error sometimes depends on array's size, but not in this case. It occurs either when the array size is 30 or when it's 3.
    The error however disappears when I write a number instead of "i", but entering all of the manually isn't a case.
    I've readen that there is a pragma that would make the loop to be manually manually executed "i" times in the code, but I don't think that is an elegant solution.
    Variable "i", that is used to index the LightDir_tan is simply incremented in for loop.

    I'd like to know what causes this error and how to fix it.
    I'm using Windows 8 and NVidia GeForce GT 720M graphics card, if that matters.

  2. #2
    Intern Contributor Brokenmind's Avatar
    Join Date
    Feb 2014
    Location
    Aachen / Germany
    Posts
    71
    It might not be possible in your case:

    [...] Under GLSL version 3.30, sampler arrays [...] can be declared, but they can only be accessed by compile-time integral constant expressions. So you cannot loop over an array of samplers.

    Under GLSL 4.00 and above, arrays of opaque can be accessed by non-compile-time constants, but there are still limitations.
    Source: click me

  3. #3
    Intern Newbie
    Join Date
    Feb 2014
    Posts
    38
    I'm using version 4.30 and the array is just an array of vec3s, not a sampler array.

Posting Permissions

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