Quantcast
Channel: GLSL / Shaders - Processing 2.x and 3.x Forum
Browsing all 212 articles
Browse latest View live
↧

unexpected texture behaviour when combining PShapes via addChild()

I find I'm unable to mix textured and non-textured shapes in a PShape GROUP. I am combining several 3D shapes into one group via PShapes addChild() method. everything works until I add a shape that has...

View Article


GLSL gl_position issue

I'm writing an android app, that uses native code via jni and also opengl. So here is my issue: When I pass to my vertex shader, vector and matrix: vector 0.0, 0.0, -6000000.0, 1 matrix 02.1632595,...

View Article


translate processing code into glsl

Hello, I have written this algorithm with Processing and I'm trying to rewrite it in glsl. I think I'm close to the solution but I'm missing something because I don't get the same result: code to...

View Article

Controlling the perspective plane position.

Why is there a "near" clipping plane in perspective()? And why would I not want to set it to, say, zero? I'm guessing that somehow it must become an expensive graphics operation if the clipping plane...

View Article

How to precompile shaders in processing.js and avoid runtime error linking...

I'm looking for info how to precompile shaders in processing.js and WebGL so they are not linking during runtime. Now I have following error under IE 11, Windows Phone 8.1 JavaScript runtime error:...

View Article


Back-translate a method from JOGL2 to JOGL1?

Hello, I am new to Processing and to OpenGL. I ran into a version problem that I just can't seem to solve. Basically, I want to back-convert a method that uses JOGL2 to JOGL1. Why? I am merging two...

View Article

How to use a Shader in Cellular Automata sketch so that it runs faster?

Hello, was wondering if anyone fancied pointing me in the right direction? I have been researching Cellular Automata and have a sketch running in Eclipse that scrolls through iterations of a CA...

View Article

Image may be NSFW.
Clik here to view.

how to avoid transparent pixels to appear black

Hello, I'm using shaders to display rectangles as circles using a vertex point shader (frag shader) but depending of the angle of my camera the transparent zones appear as black (see below). Is there a...

View Article


samplerCube and ambient reflection

Hello, I'm trying to make a glsl shader to do reflection in a skybox. I created my skybox in processing with a textured cube, but i don't find a solution to set a samplerCube uniform in my shader. Any...

View Article


Getting black objects from vertex.setFill()

I'm trying to color 3D PShape. if I perform vertex.setEmissive(color) on each vertex this does color the object as expected but this is simply emissive color unaffected by the scene lighting. if...

View Article

How to create basic shadows?

I've been trying to create shadows for some time now, but I really don't know where to start. All tutorials I find on the internet are for C++ sketches or Blender and since my knowledge in GLSL is very...

View Article

Indirect index into implicitly-sized array

I want to use multiple colors that are stored in an array. Here I set red and green for example: targetColorsRGBA = new float[] {1, 0, 0, 1, 0, 1, 0, 1}; shader.set("targetColors", targetColorsRGBA,...

View Article

Image may be NSFW.
Clik here to view.

Shader add multiple uvs from same texture

I want to write a shader that takes in a main texture, splits it in 9 equal pieces and outputs only the one in the center, but for each pixel, overlay the corresponding ones from the other 8 pieces...

View Article


Use an extra texture with a shader

I wan't to use an extra texture with a shader. For some reason I get this error: The shader doesn't have a uniform called "textureB" OR the uniform was removed during compilation because it was unused....

View Article

How can I access texOffset

I want to use texOffset in order to loop over some pixels. In my vertex shader I added: out vec2 texOffset; And in the fragment shader I added: in vec2 texOffset; And I try to use it with: float xInc =...

View Article


Perform a shader on every channel

Inside a fragment shader I have a loop like this: for (float x = 0; x < vertTexCoord.x; x += xInc) { vec2 pos = vec2(x, vertTexCoord.y); fcount += texture(texture, pos).r; // red for now } In this...

View Article

Image may be NSFW.
Clik here to view.

Blend results in LIGHTEST fashion

I use a shader to select a color. Here it is for blueish for example: Here for redish: Now I wan't to blend the 2 in a LIGHTEST kind of fashion. I tried blend(img, 0, 0, 512, 512, 0, 0, 512, 512,...

View Article


Why can't I set vertTextCoord as fragColor?

Cannot link the shader program... #version 410 uniform mat4 transform; in vec4 vertex; in vec4 color; in vec4 texCoord; out vec4 vertColor; out vec4 vertTexCoord; void main() { gl_Position = transform...

View Article

Why can't I set colors using full alpha.

We have 32bits for the colors. So for ARGB we have 8 bits for each channel. So in theory I should be able to make a color with for example. red 255 green 0 blue 0 alpha 0 So a full red color that you...

View Article

Image may be NSFW.
Clik here to view.

Is this a shader problem or a processing problem

If I close the following sketch using the close mark: Then it doesn't go so well... # A fatal error has been detected by the Java Runtime Environment: # SIGSEGV (0xb) at pc=0x00007fff941ef4bd,...

View Article
Browsing all 212 articles
Browse latest View live