Shader Help Thread

Ask about editing graphics, sounds, models, music, etc here!
Shaders (GLSL) and SNDINFO questions also go here!
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.

Re: Shader Help Thread

Postby Dr. Van Nostrand » Fri Sep 07, 2018 1:37 am

Ah I see... I've clearly got a lot to learn. I hadn't touched most of these newer features yet. Thanks again!

lol wow the effect is way too fast as I had it originally! Here's a more subtle version in case anyone else is looking for a simple underwater warp shader
Attachments
screenwarp.pk3
(1.03 KiB) Downloaded 33 times
User avatar
Dr. Van Nostrand
 
Joined: 10 May 2015

Re: Shader Help Thread

Postby Pixel Eater » Fri Sep 07, 2018 1:42 am

lol wow the effect is way too fast as I had it originally!

Yeah I think I went cross-eyed the first time :lol:
User avatar
Pixel Eater
I sense evil I fear it here today, Like a bad dream that never goes away -MBerry
 
 
 
Joined: 02 Aug 2017
Location: In between the Moon and you, between the buried and me.

Re: Shader Help Thread

Postby Pixel Eater » Thu Sep 20, 2018 8:39 pm

I wonder if someone can explain how the alpha property works for texture shaders? It's always seemed non-linear to me and impossible to counteract. Something I've just tried doing is actually causing me to be suspicious it's a bug but I want to make sure I'm not missing something.

So I have a 3D floor with the line opacity property set to 254. I have the software fuzz shader being applied to it's texture, multiplying the pixels' alpha (ie. colour.a) by values between 0.1875 and 0.65625. But what I get are low alpha values being shunted to zero (or lower?) instead. Previously I've assumed it was my error and just abandoned projects until I can figure it out, only now I'm using someone else's proven code verbatim.



You can see the detail is greatly reduced in the bridge compared to the spectre even though they share identical code. Are we supposed to treat colour.a differently in custom shaders?
User avatar
Pixel Eater
I sense evil I fear it here today, Like a bad dream that never goes away -MBerry
 
 
 
Joined: 02 Aug 2017
Location: In between the Moon and you, between the buried and me.

Re: Shader Help Thread

Postby Cherno » Sun Nov 11, 2018 3:23 pm

Hello, I have a question regarding shaders in zDoom. First of all, I have writen my own shaders before in some Unity projects so the basic concepts are not new to me.

I would like to know if it's possible to have a material for a md3 model that shows it's bitmap texture mapped to the viewport, as opposed to being uv-mapped to the model's local vertices. So, if the model moves on screen, the triangle(s) in question would just show a different part of the texture. If you remember the "fake specular" effect in Alone in the Dark (for thing like metallic and reflective surfaces), you know what I'm talking about.

The effect can be seen here, in the small mirror item:

https://www.youtube.com/watch?v=9lWaQe8 ... .be&t=1497

Can this be done?
User avatar
Cherno
 
Joined: 06 Dec 2016

Re: Shader Help Thread

Postby Cherno » Sun Nov 25, 2018 12:03 pm

I know that MD3s can use materials, but can they also use custom shaders?
User avatar
Cherno
 
Joined: 06 Dec 2016

Re: Shader Help Thread

Postby SPZ1 » Mon Feb 18, 2019 2:33 pm

Instead of making a new thread I'm bumping this one

I'm looking to make a shader to rotate a graphic at the center but have been unsuccessful. I tried modifying the shader that is in the wiki all sorts of ways but the results were just varied wave patterns. Is this even possible?
User avatar
SPZ1
 
Joined: 02 Aug 2017
Location: Illinois

Re: Shader Help Thread

Postby RSSwizard » Tue Mar 26, 2019 3:36 pm

All im interested in is using those screen shaders like the Blaarg CRT stuff from zsnes.
Old school scanlines and rf artifacts like a vcr recording.
How do you get that going in zdoom?
User avatar
RSSwizard
 
Joined: 11 Jan 2016

Re: Shader Help Thread

Postby Pixel Eater » Wed Mar 27, 2019 1:23 am

SPZ1 wrote:I'm looking to make a shader to rotate a graphic at the center but have been unsuccessful. I tried modifying the shader that is in the wiki all sorts of ways but the results were just varied wave patterns. Is this even possible?

Give this one a try instead:
Code: Select allExpand view
uniform float timer ;
const float pi = 3.14159265358979323846 ;

vec4 Process( vec4 colour )
{
   vec2 pos = gl_TexCoord[0].st - .5 ;
   float hyp = sqrt( pos.x * pos.x + pos.y * pos.y );
   
   if( hyp < .5 ) //narrows the effect. max is .707 but just comment out this line at that point.
   {
      float rad = atan( pos.y / pos.x ) + timer ; //try radians( 45 ) instead of timer for a fixed angle.
      rad += pi * ( .5 - sign( pos.x ) * .5 );
      
      pos.x = cos( rad );
      pos.y = sin( rad );
      pos *= hyp ;
   }
   
   return getTexel( pos + .5 );
}


RSSwizard wrote:All im interested in is using those screen shaders like the Blaarg CRT stuff from zsnes.
Old school scanlines and rf artifacts like a vcr recording.
How do you get that going in zdoom?

There's scan lines in Retroshader and some other neat stuff.

I'm slowly working on a new Screem that will have them too:

It's also enabling pixelation with a softening filter.
User avatar
Pixel Eater
I sense evil I fear it here today, Like a bad dream that never goes away -MBerry
 
 
 
Joined: 02 Aug 2017
Location: In between the Moon and you, between the buried and me.

Re: Shader Help Thread

Postby furyweb » Sat Apr 06, 2019 7:38 pm

Is it possible to add a shader just to the HUD weapon rather than the whole screen. I was hoping to get the Retro pixel shader working just on the weapons rather than the whole screen.

Thanks.
User avatar
furyweb
 
Joined: 30 Aug 2018
Location: UK

Previous

Return to Assets (and other stuff)

Who is online

Users browsing this forum: .+:icytux:+. and 1 guest