Thanks for the reply mbentrup!
Type: Posts; User: Mukund
Thanks for the reply mbentrup!
Hello All!
I am reading this excellent collection of articles on projective spaces, transformations etc.
I came across this sentence:
LINK
I'm not able to understand what exactly...
Thanks for the replies. So, he just means to say, the color at a pixel could be the result of samples from many neighbouring pixels, and not just one pixel?
Hello All!
This is with reference to the famous article "A pixel is not a little square" by Alvy Ray Smith. Well i tried reading it a couple of times. But i got lost somewhere after the second...
Hello,
I am trying to get billboarding to work. I needed a little clarification. This is the way i tried:
From the modelview, i obtain the following:
-- --
| x1 y1 z1 ...
Hello,
You can try this:
Say the model is at (Wx, Wy, Wz) in world coordinates, bring the model to the origin. So, do a translate of (-Wx, -Wy, -Wz). Scale it, then translate back.
So, your...
Thanks for the suggestions mobeen, tksuoran.
Hello everyone,
I was looking for a book that explains in depth about lighting in Computer Graphics. The books i read used to deal with lighting in a brief manner. i.e provide a lighting...
Thanks for the suggestion thokra!
Thanks for the reply Thokra
What is the general approach followed? In case of games they have so many complex animation effects. They would be using mutiple shaders right? Having multiple effects...
Hello everyone,
I have a bunch of animations done in a scene. These animation effects are achieved in different shaders. This is how I'm using multiple shaders.
void renderScene(void)
{
...
Thanks for the answers :)
Hello everyone,
I was wondering if its possible to obtain the contents of the framebuffer, then update it somehow and then get it back refreshed on the screen?
Well i could use an FBO, render to...
Giving Z as 0.0f would definitely not work. That is behind the specified near plane.
Try to visualize the frustum and verify if your object is within the view frustum.
Convert the...
Thanks Carsten Nuemann.
Yes. I'm giving it in eye space.
Yeah, i guess that was the problem. I increased the specular colour. Now it is better. But it looks quite different with the...
@aqnuep: Thanks!
@Groovounet: Well GLSL version 1.2(the one i'm using) doesn't seem to support it. But yeah, i didn't know we could use mix that way from 4.0 onwards.
Thanks!
Hmm, i came up with this one:
float val = step(dis, 5.0);
gl_FragColor = mix( color * vec4(0.5, 0.5, 0.5, 1.0),
color * vec4(1.0, 1.0, 1.0, 1.0),
...
Thanks V-man, aqnuep, mbentrup.
@V-man
>> and then you change your "if (dis <= 5.0)"
I didn't quite get you. Change that to what?
Thanks!
Thanks for the reply aqnuep.
>>Actually the branching (if) is much more costly.
Well, i need to do the check every fragment. Any idea how i can make it better?
Thanks!
Hello all,
This is my fragment shader:
varying vec4 color;
varying vec3 fragPos;
uniform vec4 lightPos;
Ah, i'm sorry, i hadn't normalized the light vector.
Here is the modified one:
vec3 lightVec = normalize(lightPos.xyz);
float lambertTerm = dot(normal, lightVec);
Here is the snapshot:
Thanks Carsten Neumann. I fixed that problem. I'm now doing all calculations in eye space.
Here is the new shader. I'm still doing a per vertex calculation and the specular component is totally off....
Hello everyone,
i wrote this simple shader for some lighting. The calculation of the specular component is borrowed from the Orange book.
Here is the vertex shader:
I'm trying a simple...
Hi,
It was just a problem with enabling and disabling textures. Its solved now.
Thanks.
Thanks for the reply Dark Photon.
>> Check for GL errors
Well, i am not getting any error reported.
>> Try changing glClearColor to red before your glClear, comment out drawScene(), and see...