Skip to main content
Participant
November 30, 2023

Custom Shader Error: Undefined variable 'environment_rotation'

  • November 30, 2023
  • 1 reply
  • 772 views

Hello!
I am using a custom shader as part of a pipeline and it generates this error, failing to render:

error C1503: [Shader Helpers] .... error C1503: undefined variable "environment_rotation" 

 

I saw one related post that suggests 'environment rotation' variable has been replaced by 'environment_matrix', substituting each instance  then generates a new error:

[Shader Helpers] 5(368) : error C7623: implicit narrowing of type from "vec3" to "float"

I assume this is because the newer environment matrix is a different data type, but some guidance on how to update the .glsl file to work properly would be helpful.

 

I did try one fix that allows the shader to render, replacing 'environment_rotation' with 'uniform_environment_rotation', but I am not sure if this matches the previous shader exactly. 

 

 

Any tips?

Thanks!

1 reply

Léna Piquet Froyok
Adobe Employee
Adobe Employee
December 1, 2023

Hi,

 

How were you using the environment_rotation variable previously ? There may not be only one solution to the problem you have.

 

The rotation angle has been changed into a matrix given that the environment map can now be made to follow the camera, so the rotation can happen on 3 axes instead of along a single one like before.

 

You can see how this behavior changed in the lib-env.glsl file inside the worldToEnvSpace() function.

 

Also uniform_environment_rotation is not a variable I'm aware of that we would manage in the application, which means it is likely to be considered like another generic uniform in the shader. It may let the shader compile but will have no effect.