Rainbow issue appear on surface of the 3D model

Hardware: TDA4VL

Hi experts,

We encountered the rainbow problem when calculating the reflected light in the shader. By narrowing down, we found that if we turn off diffuse and specularr calculations, there will be no such problem. I don’t understand why this happens, can you tell me the rootcause? If you have similar experience, please tell me how to solve it.

PS: I used the same code and the same model to run in TDA2P, and there was no similar problem (or the problem was very subtle)

Please check the issue as below,
enable the diffuse(Lambertian model) and specular(Phong model) calculation

just enable ambient color

Looking forward your feedback!

Hi axel,

Thanks for your message.

It is difficult to know the root cause without having a running application and device to try reproduce it, but there are two common causes for this kind of issues:

  1. Color space: Verify the color space of the textures you are using in your application. Usually, albedo textures are in sRGB color space. When doing operations in a shader, the color space should be Linear. Texture values read from a texture in sRGB color space should be converted automatically to Linear, and fragment shader values written to the output framebuffer should automatically be converted from Linear to sRGB if the correct setup has been done (otherwise you might need to do the conversion yourself) assuming the framebuffer has a format with sRGB color space. See Image Format - OpenGL Wiki
  2. Shader precission: Review the precission used in both the vertex and the fragment shader. You can try a first pass setting all variables and varyings as highp, and test whether the issue is still present.

Please let me know if you have any issues after trying the points adviced.

Best regards,