A programming language for OpenGL shaders.

learn more… | top users | synonyms

0
votes
0answers
299 views

GLSL gl_ModelViewMatrix breaks my code?

So I have the following shaders which work (to the extent that they are completed anyway). //Vertex Shader uniform float offset; void main() { gl_TexCoord[0].t = gl_MultiTexCoord0.t; ...
0
votes
0answers
289 views

Specular Light not working Phong shading

I want to implement Phong-Shading using GLSL. I also want to calulate all values using uniforms in the shaders. Nearly everything works fine, but there is an error with the specular term of the ...
0
votes
1answer
126 views

How to alter the angle of texture projection

I'm currently working on a 3Dish game; it's on a grid, with 3D props and the camera looking down on the grid at about 45º, but I want to use 2D sprites for the player and NPCs. Currently, I'm using a ...
0
votes
1answer
2k views

Simple pass-through geometry shader with normal and color

I've written a very simple pass-through geometry shader. My input and output primitives are points. I also want to forward the color and normal from vertex shader to fragment shader through geometry ...
0
votes
0answers
1k views

ssao implementation

I try to implement a ssao based on this tutorial: link I use a deferred rendering and world coordinates for shading calculations. When saving gbuffer a vertex shader output looks like this: ...
0
votes
1answer
446 views

Correct Rotation and Translation with a 4x4 matrix

I am using a 4x4 matrix to transform verts in a shader. I multiply an identity matrix by a rotation matrix by a translation matrix. I am trying to first rotate the verts and then translate them, ...
0
votes
1answer
1k views

Formula for replicating glTexGen in OpenGL ES 2.0 GLSL

I also posted this on the main StackExchange, but this seems like a better place, but for give me for the double post if it shows up twice. I have been trying for several hours to implement a GLSL ...
0
votes
1answer
388 views

OpenGL Tessellation makes point

A little problem with my tessellation shader. I try to implement a simple tessellation shader but it only makes points. Here's my vertex shader : out vec4 ecPosition; out vec3 ecNormal; void ...
-1
votes
2answers
55 views

GLSL Normals not transforming propertly

I've been stuck on this problem for two days. I've read many articles about transforming normals, but I'm just totaly stuck. I understand choping off W component for "turning off" translation, and ...
-1
votes
1answer
211 views

is instanced rendering faster? [closed]

Is instanced rendering used in GLSL faster than doing something like this.. for(int i=0; i<10; i++) { glDrawArrays(GL_POINTS, 0, 3000); } Suppose I want to render 'grass', which is the best ...
-1
votes
1answer
160 views

OpenGL shader problem

So, I've been working on this game engine for a while now, and just the other day my friend tried running the program and his output doesn't match my output... My Program Output: His Program ...
-1
votes
2answers
251 views

GLSL: Why can only some of the matrices be found? [closed]

I've been learning GLSL and to start I've been trying to replicate the fixed-function pipeline functionality with it, for 2D graphics. I've done it successfully in most things, so far, but I came into ...
-1
votes
1answer
459 views

GLSL code is very slow…why? [closed]

I know this is a very difficult thing to simply modify without the full project code, but I am having a massive performance problem with GLSL code that seems to be very efficient to me. I am stuck at ...
-1
votes
1answer
95 views

Unity's pack 4 floats

Linked to: GLSL pack floats into an RGBA texture I found EncodeFloatRGBA/DecodeFloatRGBA shader functions in Unity https://gist.github.com/hecomi/9580605 Now I try to figure out how they work. So I ...
-1
votes
1answer
104 views

More than 8 lights without deferred shading / lighting [closed]

I want to know if there is any technique (efficient) to use more than 8 lights in a scene made ​​with OpenGL and GLSL. Without making use of deferred shading / lighting. I have not implementadon ...
-1
votes
0answers
86 views

Best real-time method for fast glass rendering (like cups, vases, sculptures etc.) in WebGL

I am looking to use the best method available for fast rendering glass architectural features (like cups, vases, sculptures) in WebGL. I am not interested in writing a full ray-tracer. I was ...
-1
votes
2answers
163 views

Models are not rendered correctly. OpenGL

I'm working on my university OpenGL project and as a base of it I'm trying to combine several OpenGL tutorials, mainly tutorials from http://ogldev.atspace.co.uk/. The problem I have is that models ...
-1
votes
1answer
113 views

Shader applied to Texture is not showed in GLSLES

I'm trying to learn the basic of shaders following basic tutorials in Ogre. I use GLSL ES 2.0 #version 100 I think I have a basic concept problem. I'm trying to render a model + texture without make ...
-2
votes
1answer
56 views

GLSL- How to change a certain color of a sprite, to another color passed into the shader?

I have been googling for over an hour, trying to find out how to do something very simple, which I see in tons of games. I tried to understand GLSL, but it seems like a ton of learning for a single, ...
-2
votes
1answer
66 views

List of GLSL ES built-in variables

I am writing an article on WebGL and three.js, I'm trying to search all the built-in variables available in the vertex and fragment shader. I've found many sites mentioning some, for example: ...
-3
votes
1answer
110 views

GLSL does weird things to my view matrix [closed]

uniform mat4 model; uniform mat4 view; varying vec4 vColor; void main(){ gl_TexCoord[0] = gl_MultiTexCoord0; gl_Position = view * model * gl_Vertex; vColor = gl_Color; if(view * ...
-5
votes
3answers
351 views

in the shadow of a sphere [duplicate]

(Related, but somewhat different, to my previous question) How can I determine in a fragment shader if a fragment is in the shadow of a sphere? That is, if it is occluded by the sphere and is past ...