Pass spheremap coords to fragment shaders

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

Pass spheremap coords to fragment shaders

Postby Marisa Kirisame » Sun Nov 01, 2020 6:39 am

After struggling for a long time to implement a proper matcap shader in GZDoom, I've come to the conclusion that it is ENTIRELY IMPOSSIBLE to do it with the limited information available, and any approximations only end up looking horribly broken.

main.vp seems to have this data, but it just stays there unless SPHEREMAP is defined (what for, I wonder). I absolutely need this.

Alternatively. We are provided with a view space "eye normal", but we don't have an "eye direction" equivalent.
User avatar
Marisa Kirisame
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: 霧雨魔理沙#1666
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Pass spheremap coords to fragment shaders

Postby Graf Zahl » Sun Nov 01, 2020 7:30 am

SPHEREMAP is only set by the shader for the mirror overlay.

There's one problem with this suggestion: We cannot preemptively pass around too much data in the shader, especially data that's normally not needed. This can become very costly on older hardware.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Feature Suggestions

Who is online

Users browsing this forum: Marisa Kirisame and 0 guests