Moderators: GZDoom Developers, Raze Developers
lol wow the effect is way too fast as I had it originally!
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?
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?
The following uniform variables are always available to your shaders:
int fogenabled
vec4 fogcolor
vec3 dlightcolor
vec3 camerapos
float desaturation_factor
vec4 topglowcolor
vec4 bottomglowcolor
int texturemode
sampler2D tex
float timer
If you wish to use the timer uniform, you must define it yourself at the top of your shader file.
If the DYNLIGHT define is defined, the following uniform variables available:
ivec3 lightrange
vec4 lights[256]
Only if MAXLIGHTS128 is not defined
vec4 lights[128]
Only if MAXLIGHTS128 is defined
The following varying variables are always available to your shaders:
float lightlevel
vec2 glowdist
vec4 pixelpos
vec4 fogparm
layout(location = 0) out vec4 vTexCoord;
layout(location = 1) out vec4 vColor;
layout(location = 2) out vec4 pixelpos;
layout(location = 3) out vec3 glowdist;
layout(location = 4) out vec3 gradientdist;
layout(location = 5) out vec4 vWorldNormal;
layout(location = 6) out vec4 vEyeNormal;
layout(std140) uniform ViewpointUBO {
mat4 ProjectionMatrix;
mat4 ViewMatrix;
mat4 NormalViewMatrix;
vec4 uCameraPos;
vec4 uClipLine;
float uGlobVis; // uGlobVis = R_GetGlobVis(r_visibility) / 32.0
int uPalLightLevels;
int uViewHeight; // Software fuzz scaling
float uClipHeight;
float uClipHeightDirection;
int uShadowmapFilter;
};
Return to Assets (and other stuff)
Users browsing this forum: No registered users and 0 guests