Texture displacement togglable by a CVAR?

Ask about editing graphics, sounds, models, music, etc here!
Shaders (GLSL) and SNDINFO questions also go here!

Moderators: GZDoom Developers, Raze Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Texture displacement togglable by a CVAR?

Postby KUBA18i » Sun Mar 13, 2022 10:30 pm

Hello.
I'm playing around with shaders, namely the one from this thread. It allows me to give flat textures actual depth, and I like it. However, it's effects give off a strange vibe of warping around dependending on the player's position and movement, so I want to be able to disable the effect without just removing the code from the PK3.

The code is controlled by GLDefs definitions which call upon a shader file, for those interested it goes like this:
Spoiler:

Spoiler:


Now, I have defined a CVAR for the job, like so:

Code: Select allExpand view
user bool JM_texdisp = true;


I tried putting the whole shader code under a bracket that goes like
Code: Select allExpand view
if(JM_texdisp)
{
STUFF
}

but that just crashed the game :mrgreen:

Any help would be appreciated. If there are commands to control aspects of things like this already, I would like to know them(I couldn't find them, and the article on CVARs on the wiki seems to be a bit out of date). So far, the only way to change how deep the displacement gets is editing the PNG itself.
KUBA18i
 
Joined: 28 Oct 2019
Location: Sosnowiec, Silesia, Poland
Discord: KUBA18i#6130
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)

Return to Assets (and other stuff)

Who is online

Users browsing this forum: No registered users and 2 guests