Proposed workaround for errors when highlighting selections in the Hydra plugin


I am looking deeply into the implementation of the Hydra plugin.
One thing I found out about USD 20.08, I will describe it.

For example, when using the Hydra plugin for Blender Cycles, an error occurs in the selection operation.

Coding Error (secondary thread): in SetProgram at line 163 of xxx\pxr\imaging\hdx\fullscreenShader.cpp -- Failed to create HdxFullscreenShader shader program
Coding Error (secondary thread): in HgiGLShaderProgram at line 51 of xxx\pxr\imaging\hgiGL\shaderProgram.cpp -- Failed verification: ' id>0 ' -- Invalid shader provided to program

I am looking into the implementation of the Hydra plugin and have found that the implementation to get around this would take a tremendous amount of man-hours.
(if resolved within the Hydra plugin)
Note that Storm does not seem to go through the path that causes this error.

Upon investigation, it seems to be due to the use of “gl_FragColor” in the GLSL Shader in Hydra’s hdx, which is legacy.

proposed amendment

Fix fullscreen.glslfx and outline.glslfx in hdx.
I replaced it with an implementation that does not use gl_FragColor.

out vec4 out_color;  // Here!

void main(void)
    float depth = texture(depth, uv).r;
    //gl_FragColor = texture(color, uv);
    out_color = texture(color, uv);   // Here!
    gl_FragDepth = depth;

(I am not sure if fullscreen.glslfx is receiving the color of the output)

I have uploaded the modified glslfx file here. (4.0 KB)

GLSL Shader seemed to be good enough to adjust the files in the following folder.


With this modification, Blender Cycles now works as follows.

In the Hydra plugin implementation, the difficulty level seemed to increase dramatically when implementing our own highlighting process for this selection.

I am experiencing the same issue with USDView in USD 20.08.
This is just a workaround, but could you please work around this error in the highlighting process on the Omniverse Hydra side?

Confirmation environment

  • Windows 10
  • Omniverse Create 2022.1.5

Yes, this is a known issue (OM-46196) inside that USD GLSL shader we hit during the Blender Hydra render delegate development as well on display drivers newer than R470 versions which got more strict about gl_FragColor and the GLSL versions supporting it.

It’s one of the reasons Omniverse still recommends R470 drivers:

I added your case to the Omniverse bug report.

Thanks for your prompt reply!
I see, so it affects the driver version.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.