All Questions

Tagged with
Filter by
Sorted by
Tagged with
0
votes
0answers
20 views

Flatten Sampler2D to 1D WebGL

I'm encoding a large array into a texture that I can reference in my glsl shader. The array is far to long to encode in a 1d array, so I encoded it as a 2d array. Now I would like to reference each ...
0
votes
1answer
55 views

"Scan Through" a large texture glsl

I've encoded some data into a 44487x1.0 luminance texture: Now I would like to "scrub" this data across my shader, so that a slice of the texture equal in width to the pixel width of my ...
0
votes
0answers
65 views

How to set texel invisible depending on a texture from another object

Introduction I want to be able to create a sort of fog of war for my app using shaders. I feel that I might be close, but I can't figure out how to make it work… (maybe I don’t have the right approach ...
2
votes
2answers
73 views

WebGL textures from YouTube video frames

I'm using the technique described here (code, demo) for using video frames as WebGL textures, and the simple scene (just showing the image in 2D, rather than a 3D rotating cube) from here. The goal is ...
-2
votes
0answers
51 views

Why does the WebGL shader gives me a syntax error?

I just started learning Three.js and am trying to make my first project, but the shader gives me a silly Uncaught SyntaxError: Unexpected token '{' I don't know why. Everything looks good, I think. So ...
0
votes
0answers
38 views

Plot points from data texture in glsl shader

I have encoded 100 float values into a 100x1 image texture. The original values were between a range of 0-1, but I remapped them to 0-255 so I could see them in the texture: I would like to plot ...
0
votes
1answer
28 views

three.js MeshLine vertex implementation

I'm struggling with correct vertex shader implementation for fat lines. I tried using spite/MeshLine, but it hasn't proper mitering which is a must for me. Therefore I started my own implementation (...
1
vote
1answer
123 views

OpenGL: Problem with lighting when rotating mesh

I'm drawing some static geometry (a sphere, a cube, etc.) together with some dynamic geometry (a rotating torus.) I can see that there is a problem because specular lighting on the torus is static and ...
0
votes
1answer
128 views

Problem with normals when drawing instanced mesh

I'm rendering a sphere with instanced drawing, while rotating the model-view-matrix around the Y axis. It looks ok at the beginning: But at another angle, things get worse: It looks to me like a ...
0
votes
1answer
47 views

Translate shadertoy texture to webgl not behaving the same

I'm able to translate the code and run it, but it behaves diferrent from the orginal fork. https://www.shadertoy.com/view/llS3zc --orignal https://editor.p5js.org/jorgeavav/sketches/i9cd4lE7H - ...
0
votes
0answers
55 views

Accessing textures in PIXI.Filter fragment shader

I'm trying to pass an image texture to my fragment shader (PIXI.Filter) but it won’t draw. const loader = PIXI.Loader.shared; const KEY = 'testImg'; loader.add(KEY, testImg); loader.load((loader, ...
1
vote
1answer
32 views

Apply transformation in a fragment shader

I know that I can perform a transformation(rotation,scale) in the vertex shader. However I wonder if I can do the similar thing in the fragment shader. shadertoy.com - transformation_in_fragment_shade ...
4
votes
2answers
166 views

Creating cursor trail with fragment shader

I wish to draw a simple mouse trail using fragment shaders, similar in appearance to drawing the following in processing (omitting the step of clearing the canvas). I cannot wrap my head around the ...
1
vote
1answer
90 views

How to run a shader from shadertoy in your js file with webgl and glsl [closed]

Im new to programming shaders and i want to create a shader with webgl and glsl. To see how it really works i want to test a shader from shadertoy. But how do you take the code from shadertoy and ...
0
votes
1answer
84 views

How can I correctly translate/rotate my camera in my 3d raymarched world

What I am trying to achieve So I'm a fractal enthusiast and decided to build a 2D/3D fractal generator in WebGL using raymarching, with Typescript as scripting language. I've been a C#/Typescript dev ...

15 30 50 per page
1
2 3 4 5
48