Questions tagged [fragment-shader]
A GPU program used in rendering. It is executed for each sample taken from a rasterized primitive. The output of this process is a number of values and a floating-point depth.
fragment-shader
1,541
questions
0
votes
0
answers
5
views
Julia Sets code along with p5.js and shaders not working
This is my julia.frag
#ifdef GL_ES
precision mediump float;
#endif
varying vec2 pos;
const float MAX_ITEARTIONS = 1000.0;
float calculateEscapeRadius(float power, vec2 c) {
// Compute the ...
0
votes
0
answers
35
views
Reaction diffusion with shaders on WEBGL
I'm writing a reaction diffusion simulation with p5js based on a video and this tutorial. The code so far is this:
var vertSrc = `
#ifdef GL_ES
precision mediump float;
#endif
attribute vec3 ...
0
votes
0
answers
20
views
How To Let ShaderMaterial Receive/Cast Shadows
So, I have been playing around with vertex and fragment shaders, and wanted to know if there was a way to add shadows to the fragment shaders? I have tried many unsuccessful attempts, and researched a ...
-1
votes
1
answer
50
views
GLSL bouncing ball issue
#ifdef GL_ES
precision mediump float;
#endif
uniform vec2 u_resolution;
uniform vec2 u_mouse;
uniform float u_time;
vec3 color_bg = vec3(1.0);
vec3 circle_color = vec3(0.0, 0.0, 0.0);
void circle(...
0
votes
1
answer
23
views
Fix Incorrect Colors on Godot4 Shader
Inconsistent Results for Grass Shader Sampling Ground Texture Between Different Renderers
I'm currently developing a Grass Shader that samples the ground texture in Godot 4. However, I've encountered ...
0
votes
0
answers
30
views
Sync issue for gl_InstanceIndex between vertex and fragment shader
I'm trying to implement this OpenGL text-rendering tutorial in Vulkan:
https://learnopengl.com/In-Practice/Text-Rendering
and the improvements in this video:
https://www.youtube.com/watch?v=...
0
votes
1
answer
28
views
Issue with reading texture data inside RESHADE Pixel Shader
I am new to reshade, but not new to programming as a whole. I tried to implement a compute shader using modern re shade, who's information was then passed to a pixel shader that passed that data to ...
0
votes
1
answer
16
views
When using points in ThreeJS there is a black background on each point if using depth writing
I have a scene where I use points, like so
<points ref={gPoints} position={position}>
<bufferGeometry attach="geometry">
<bufferAttribute
...
0
votes
1
answer
175
views
GLSL fragment shader Sine wave change the direction and color
I have glsl Fragment shader code need to change the line color, background color and, direction of the sine wave
eprecision mediump float;
#endif
uniform vec2 u_resolution;
uniform vec2 u_mouse;
...
4
votes
1
answer
73
views
OpenGL depth test with unclamped range
I'm using a OpenGL pipeline with a vertex and fragment shader, which is such that early fragment tests need to be enabled.
So the depth test is always done with the vertex shader output gl_Position.z ...
1
vote
0
answers
29
views
Drawing text over a shader
I have been going through Ebitengine's great tutorial for Kage https://github.com/tinne26/kage-desk/blob/main/docs/tutorials/intro/00_introduction.md (it's own shading language), and haven't been able ...
0
votes
0
answers
71
views
How can i use GLSL shaders with raylib-rust?
Right now i'm trying to use a simple shader in my raylib app.
This is my simple_shader.fs file
#version 330
out vec4 fragColor;
void main()
{
fragColor = vec4(0.0, 0.0, 1.0, 1.0);
}
This is my ...
1
vote
0
answers
38
views
Writing to a RWTexture2D in Fragment shaders
I'm new to this topic, and I know this sounds stupid, but I just really want to learn!
So I found out I can write to RWTexture2D from my fragment shader(according to forum), but I can't really find ...
0
votes
1
answer
47
views
GLSL input/output variables with same name in different sources
I have a GLSL program that contains 3 fragment shader sources that would get linked together, like this:
1.
#version 460 core
void RunA();
void RunB();
void main() {
RunA();
RunB();
}
#version ...
1
vote
0
answers
49
views
Shadow casted from custom GLSL unity shade doesn't match "surf" method output
Problem:
I wrote a custom shader for making animated sprites from a sprite sheet (not going into why I'm doing that rather than use Unity's animation player for this project").
It works well, but ...