fragment-shader Questions
1
There's an array of uniform blocks in my shader which is defined as such:
layout (std140) uniform LightSourceBlock
{
int shadowMapID;
int type;
vec3 position;
vec4 color;
float dist;
vec3 ...
Despondent asked 1/2, 2014 at 13:4
2
Solved
Trying to learn 3D programming, I am currently implementing a class which batch-renders cubes with OpenGL by pushing them to the GPU each frame. I tried to implement some crude lighting by 1) Sendi...
Envoy asked 17/3, 2018 at 13:55
3
Solved
I want to get an accurate modulo of x and y in a WebGL fragment shader. x and y are integers.
Graphing mod(x,y), we get the following:
The actual code used to generate the red-and-black rectangl...
Dexterdexterity asked 25/11, 2015 at 4:47
3
I would like to have a transparency effect from an image, for now I just test with a torus, but the shader does not seem to work with alpha. From what I understood from this thread (Using Blending ...
Anglocatholic asked 10/5, 2015 at 23:12
2
Solved
I cant figure out, how to get with OpenGL ES 2.0 similiar Results to OpenGL ES 1.1. I want to use actually a Sampler2D (to blend my texture with Alpha Channel to the Framebuffer) and also set an Co...
Sustenance asked 14/2, 2011 at 23:0
2
Solved
I'm trying to achieve making a gradient color as the design apps (Photoshop for example) does, but can't get the exact result i want.
My shader creates very nice 'gradients' but also contains othe...
Talca asked 19/11, 2017 at 11:51
2
As stated in the Metal Shading Language Guide:
Writes to a buffer or a texture are disallowed from a fragment function.
I understand that this is the case, but I'm curious as to why. Being able t...
Sweyn asked 25/12, 2015 at 4:14
1
Solved
I am trying to achieve an old school tv effect. But I'm having trouble finding a good way to warp the edges of the screen, an effect you can see in this example.
I'm not asking anything about ge...
Hsinking asked 20/10, 2017 at 21:56
0
I've been working on a Unity shader setup that incorporates two visual effects for a VR project.
A blurred outline glow. This works fine.
An 'inner glow' type effect. This does not work in VR/ste...
Ingram asked 19/10, 2017 at 13:12
3
Solved
I've created a custom shader to be able to use a BlendMap with 4 different textures but I'm unable to get the shadows/lightning effects to work with it.
What am I missing here? Or is there some ot...
Playbill asked 20/4, 2017 at 19:55
2
Solved
Using Three.js, I have written a vertex shader that colors each point in a plane according to which quadrant of the screen a pixel is rendered.
// vertex shader
uniform float width;
uniform float ...
Canzona asked 4/11, 2013 at 20:30
1
Solved
I want to see a wireframe of an object without the diagonals like
Currently, I add lines according to the vertices, the problem is after I have several of those I experience a major performance ...
Optic asked 28/8, 2017 at 11:11
2
Solved
I was recently looking for ray tracing via opengl tutorials. Most of tutorials prefer compute shaders. I wonder why don't they just render to texture, then render the texture to screen as quad.
Wh...
Contestant asked 25/5, 2017 at 13:31
2
Solved
Currently I read a 3D texture with the function texture(...) like this:
vec3 value = texture(texture_3D, coord).rgb
What I want to do now is:
vec3 value = texelFetch(texture_3D, coord, 0).xyz
H...
Whydah asked 10/8, 2017 at 12:7
4
I want to adjust the colors depending on which xyz position they are in the world.
I tried this in my fragment shader:
varying vec4 verpos;
void main(){
vec4 c;
c.x = verpos.x;
c.y = verpos.y...
Meimeibers asked 4/2, 2011 at 15:13
2
I came across several shaders on ShaderToy and I have not had success converting them into a format that can be used on a mobile device, such as a .fsh.
I have this Shader, and I want to be able t...
Gilbertgilberta asked 6/7, 2016 at 4:21
3
I'm using SceneKit on iOS and I have a geometry I want to render as a wireframe. So basically I want to draw only the lines, so no textures.
I figured out that I could use the shaderModifiers prop...
Laverne asked 1/3, 2015 at 13:17
1
Solved
I'm trying to write a fragment-shader that functions as a chroma-key filter for a specific color (for example make all pixels with a specific green transparent).
The shader I'm writing is for use ...
Masorete asked 18/5, 2017 at 9:26
1
Solved
I would like to create a translucent sphere, which is highlighted where it intersects other objects (for example the ground).
Like the white line in this picture:
I've found an Unreal Engine 4...
Brolly asked 10/5, 2017 at 21:3
1
Solved
I'm attempting to convert a Shadertoy to Javascript and WebGL so that it can run independently from Shadertoy. Shadertoy has the concept of a buffer, in this example it re-cycles the buffer and imp...
Heinie asked 7/1, 2017 at 9:29
1
I have two textures with different coordinates and sizes in my fragment shader:
varying highp vec2 v_currentTextureCoords;
varying highp vec2 v_backgroundTextureCoords;
uniform sampler2D u_current...
Stonedeaf asked 9/12, 2016 at 9:50
5
Solved
I've a problem with convertion of camera preview in Android from YUV format to RGB. The purpose of conversion is to apply some effects. I try to convert by fragment shader because convertion by nat...
Nuli asked 26/8, 2012 at 14:10
1
Solved
I've written a GLSL shader for use in Unity3D with my pixelated iOS app. It has two ONE problems:
1) The effect doesn't always stay with the moon, and
2) the lighting doesn't look pixelated.
I'...
Leapfrog asked 27/9, 2016 at 4:9
1
Solved
I'm trying to replicate the automatic bilinear filtering algorithm of Unity3D using the next code:
fixed4 GetBilinearFilteredColor(float2 texcoord)
{
fixed4 s1 = SampleSpriteTexture(texcoord + fl...
Plenitude asked 7/9, 2016 at 21:54
2
Solved
I want to save a calculated value from fragment shader in some variable ,so that I would be able to use it next time.
Currently, I am preparing a image using a huge algorithm and I want to save it...
Lynnelynnea asked 4/7, 2016 at 9:29
© 2022 - 2024 — McMap. All rights reserved.