Tagged Questions
-1
votes
0answers
44 views
Texture / shader template program [closed]
I would like to use OpenGL to downsize images, using shaders. I would be very grateful, if somebody can give me a sample program in C++, which loads bitmap texture, draws it to the entire screen and ...
2
votes
1answer
99 views
Texture prefetching in GLSL
I have a fragment shader which needs lots of semi-random access to 32x32 texture patch. Fortunately, the patch is constant for each poly, so there should be no issue storing the whole thing to the ...
0
votes
0answers
150 views
Regarding Multisampling of textures [closed]
i am rendering white cube with green background in non default FBO and attaching the created multisampled texture to this FBO. When i render a cube in default FBO using above texture, it gives ...
1
vote
1answer
91 views
Multisampled Texture
i have some doubts with multisampled textures.
In fragment shader, how to pass multiple samples?
We use glTexImage2DMultisample instead of glTeximage2D. so, how to upload texture data?
I want to ...
5
votes
1answer
112 views
Blend multiple regions from same texture atlas
I'm representing terrain in my game as a grid with at each node a composition, for example 100% rock, or 50% grass, 50% soil. I'd like to use this composition vector to blend textures together. I'm ...
1
vote
1answer
110 views
fragment shader with SNORM textures
I want to apply SNORM texture by using GL_TEXTURE_3D as a target, what will be the fragment shader for the same?
Also, what should be the data type of texture data?
1
vote
1answer
197 views
how to use a mask texture?
A texture pack for a sponza model contains mask textures (black and white). I guess that I should read only a red channel from that texture, right ? I use deferred rendering and for shading ...
3
votes
1answer
257 views
GLSL custom interpolation filter
I'm currently building a fragment shader which is using several textures to render the final pixel color.
The textures are not really textures, they are in fact "input data" to be used in the formula ...
4
votes
3answers
114 views
How to read BC4 texture in GLSL?
I'm supposed to receive a texture in BC4 format.
In OpenGL, i guess this format is called GL_COMPRESSED_RED_RGTC1.
The texture is not really a "texture", more like a data to handle at fragment ...
3
votes
0answers
591 views
GLSL pack floats into an RGBA texture
I want to compose conventional triangle-based models and particles with a ray-traced scene at a reasonable frame-rate.
webGL does not let you write the gl_FragDepth in the fragment shader. You ...
0
votes
0answers
2k views
GLSL Shader Texture Performance
I currently have a project that renders OpenGL video using a vertex and fragment shader. The shaders work fine as-is, but in trying to add in texturing, I am running into performance issues and can't ...
1
vote
2answers
654 views
Updating texture memory via shader?
What the title says.Is it possible to update a texture via a glsl shader ? Something like :
//Read
vec4 Pixel = texture2D(TextureID,gl_TexCoord[TextureIndex].st);
//Write to texture memory ?
vec4 ...
0
votes
1answer
552 views
Making a surface transparent from blackness of texture
I am making a "halo" shader in unity using GLSL. And I've come to a roadblock.
What I need to do is take a texture, like the following, and make it transparent according to the darkness of it. And I ...
1
vote
1answer
853 views
Why doesn't my texture display with this GLSL shader?
I am trying to display a DXT1 compressed texture on a quad using a VBO and shaders, but I have been unable to get it working. All I get is a black square.
I know my texture is uploaded properly ...
1
vote
3answers
758 views
iOS - pass UIImage to shader as texture
I am trying to pass UIImage to GLSL shader. The fragment shader is:
varying highp vec2 textureCoordinate;
uniform sampler2D inputImageTexture;
uniform sampler2D inputImageTexture2;
void main()
{
...
3
votes
1answer
464 views
Why are my texture coordinates always (0,0) in this shader?
What I'm trying to do is add my depth buffers values to my scene, ie. I'm trying to make objects closer to the camera darker and objects further away lighter. Which should be easy: just render the ...
1
vote
3answers
887 views
Is it possible to batch draw sprites that use different textures without using an atlas?
I've implemented a sprite batch class that uses a sampler array so that I can select a texture to use based on the gl_PrimitiveID. The idea was to be able to draw sprites that use different textures ...