Alienhead Posted January 24, 2023 Share Posted January 24, 2023 Hoping someone might spot instantly what I cant find wrong with my shader.. it won't run under LE. Thanks for your time. SHADER version 1 @OpenGL2.Vertex #version 400 #define MAX_INSTANCES 256 @OpenGL4.Fragment #version 400 #define BFN_ENABLED 1 out vec4 fragData0; uniform float currenttime; float time = currenttime/1000; uniform vec2 buffersize; uniform sampler2D texture1; uniform bool isbackbuffer; float range = 0.05; float noiseQuality = 250.0; float noiseIntensity = 0.0088; float offsetIntensity = 0.02; float colorOffsetIntensity = 1.3; float rand(vec2 coord) { return fract(sin(dot(coord.xy ,vec2(12.9898,78.233))) * 43758.5453); } float verticalBar(float pos, float uvY, float offset) { float edge0 = (pos - range); float edge1 = (pos + range); float x = smoothstep(edge0, pos, uvY) * offset; x -= smoothstep(pos, edge1, uvY) * offset; return x; } void main(void) { vec2 uv = gl_FragCoord.xy / buffersize.xy; if (isbackbuffer) uv.y = 1.0 - uv.y; for (float i = 0.0; i < 0.71; i += 0.1313) { float d = mod(time * i, 1.7); float o = sin(1.0 - tan(time * 0.24 * i)); o *= offsetIntensity; uv.x += verticalBar(d, uv.y, o); } float uvY = uv.y; uvY *= noiseQuality; uvY = float(int(uvY)) * (1.0 / noiseQuality); float noise = rand(vec2(time * 0.00001, uvY)); uv.x += noise * noiseIntensity; vec2 offsetR = vec2(0.006 * sin(time), 0.0) * colorOffsetIntensity; vec2 offsetG = vec2(0.0073 * (cos(time * 0.97)), 0.0) * colorOffsetIntensity; float r = texture(texture1, uv + offsetR).r; float g = texture(texture1, uv + offsetG).g; float b = texture(texture1, uv).b; fragData0 = vec4(r, g, b, 1.0); } 2 Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Josh Posted January 24, 2023 Share Posted January 24, 2023 What does "not running" mean exactly? Does it link with the vertex shader? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Alienhead Posted January 24, 2023 Author Share Posted January 24, 2023 It gives no error when I place it in Posteffetcs in the editor, but attempting to move the mouse or move around in the editor creates a jaggedy pause like. Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Alienhead Posted January 24, 2023 Author Share Posted January 24, 2023 This is the post effect I was going for - https://www.shadertoy.com/view/ldjGzV 1 Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
havenphillip Posted January 24, 2023 Share Posted January 24, 2023 This works fine for me. Is the shader compiling? Or do you mean you get some kind of lag? Quote Link to comment Share on other sites More sharing options...
Alienhead Posted January 24, 2023 Author Share Posted January 24, 2023 I set it as Posteffect, but nothing happens, then I am unable to move the camera around in the editor, nothing happens. I remove the effect and operations resume as normal. No error on the bottom where you normally see errors when applying a bad shader. Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Alienhead Posted January 25, 2023 Author Share Posted January 25, 2023 I was able to build me a less dramatic effect using less shader commands. 3 Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
havenphillip Posted January 25, 2023 Share Posted January 25, 2023 Oh that one looks cooler anyway. 2 Quote Link to comment Share on other sites More sharing options...
Josh Posted January 25, 2023 Share Posted January 25, 2023 You have a big talent for "polishing" the appearance of a game and giving it a visual theme. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Alienhead Posted January 25, 2023 Author Share Posted January 25, 2023 Much appreciated. I've decided to place defendTHIS! project on hold until Ultra gets it's editor and stuff.. I'm going to move defendTHIS! over to Ultra. In the mean time I'm finishing up my Galaga clone in LE, got about 2 months left on it - or less.. 4 Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.