Broken surface ID buffer on GTX 1070 ?
See original GitHub issueReported on Twitter: https://twitter.com/tamat/status/1580872701035495425
I haven’t been able to reproduce. My guess is the surfaceID buffer has invalid data drawn to it. That buffer is of type HalfFloat
. I picked that because I thought that’d have more support than Float
buffers, but it may be the other way around?
This buffer type is defined here:
Issue Analytics
- State:
- Created a year ago
- Comments:13 (11 by maintainers)
Top Results From Across the Web
MSI GTX 1070 Graphics card Repair - Black screen ... - YouTube
Ask questions and Engage in our Forum at https://northridgefix.com/forum/⭕ Need a repair ? http://northridgefix.com/mail-in/ ⭕ Visit our ...
Read more >#GTX1070's - Twitter Search / Twitter
The latest Tweets on #GTX1070's. ... Motherboard:MSI B360 GAMING PLUS CPU:Intel i7 9700F GPU:MSI GAMING X GTX ... Broken surface ID buffer on...
Read more >gamescope doesn't run on NVIDIA #497 - GitHub
I'm trying to run glxgears inside gamescope: gamescope -W 1920 -H 1080 -- glxgears and I get the following output: No CAP_SYS_NICE, ...
Read more >Game Ready Driver 526.98 FAQ/Discussion : r/nvidia - Reddit
There is a workaround just go to the download page from Nvidia click on the latest driver available and copy paste the link...
Read more >NVIDIA Linux Driver (For Linux) - Lenovo Support VG
Updated the VDPAU driver to reject decoding to YUV 4:2:2 video surfaces. ... following GPUs: * GeForce GTX 1080 * GeForce GTX 1070...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
OK I think I know what is causing this:
As these id values are floating point, any slight variation will produce a outline. (in general, comparing floating point values for exact values causes problems)
There are 3 ways to fix it: Solution 1) Don’t compare against exact values - change to surfaceValueDiff > 0.01 - that seems to work
Solution 2) Make sure no perspective correct interpolation is happening on the varying that will not need it - this ensures you get the exact value in the fragment shader - just put a “flat varying” in front of the shader interpolator when writing object ids. However, this needs WebGL2. FYI: Here is a good reference on perspective correct interpolation if you did not know about it: https://stackoverflow.com/questions/24441631/how-exactly-does-opengl-do-perspectively-correct-linear-interpolation
Solution 3) Another way to prevent perspective correct interpolation is to make sure position “w” value is 1. Simply do a gl_Position.xyz /= gl_Position.w; gl_Position.w = 1.0; in the vertex shader writing vertex ids.
Side note: I think you need to clamp the value “outline” when doing
gl_FragColor = vec4(mix(sceneColor, outlineColor, outline));
as outline could be > 1.0
Just adding a note here how I debugged this in case I ever need to revist: Using this video as a starting point https://www.youtube.com/watch?v=T7MPxvX5alA Using RenderDoc on an old version of ChromePortable ChromiumPortable.exe --no-sandbox --disable-gpu-watchdog --gpu-startup-dialog --disable-direct-composition Attached RenderDoc by injecting into process (this option is enabled via a toggle in settings)
Also tried to use Chrome canvas debugger, but it is removed from modern chrome. Some initial testing with https://spector.babylonjs.com/ plugin, but this does not support shader editing.
Verified live demo looks correct for me