I'm working on an SSAO implementation. I've had an idea to speed it up by having AO fragment shader finish faster for fragments that are not occluded (depending on the scene, this can be a significant portion of the screen in my case).

I tried a naive approach first: if, after the initial four samples the occlusion is still zero, we exit. This results in a significant speedup, but the quality deteriorates badly: the occluded portions become very noisy.

I was wondering if anyone else has attempted a similar optimization. Is there a better way to approach it?

Thanks! ]]>

I am new to openGL, I would like to know the calculation involved in finding the

http://nehe.gamedev.net/article/came...utorial/18010/

There are two modes.

First mode is that Camera's target is rotated.

Second mode is an Orbit mode.

I found recently GLM which is very good library written by C++.

you may already know....

Well... I have obtained two rotations that are x-axis and y-axis from mouse event(OnMouseMove) in MFC.

Among the two mode i mentioned above, I want to know orbit mode.

I usually use below code for 3D space.

glMatrixMode(GL_PROJECTION);

glPushMatrix();

{

glLoadIdentity();

float fAspect = float(m_win_w)/m_win_h;

gluPerspective(80.0f, fAspect, 1.0, 1000.0);

glMatrixMode(GL_MODELVIEW);

glPushMatrix();

{

const float DISTANCE = 100.f;

glLoadIdentity();

0.f, 0.f, 0.f,

0.f, 1.f, 0.f);

DrawSomeObject();

}

}

I think the function, gluLookAt(), is the key.

For orbit mode, I should know how to handle eye's parameters and I should apply rotations of matrix and vector to those.

However, I can't grasp these concepts with glm.

I have tried to make orbit mode camera with below code.

glm::mat4 mat = glm::mat4();

glm::vec4 pos(0.f, 0.f, 100.f, 0.f);

glm::vec4 target(0.f, 0.f, 0.f, 0.f);

glm::vec4 up(0.f, 1.f, 0.f, 0.f);

mat[0] = pos;

mat = glm::rotate(mat, glm::radians(m_fRotYaw), glm::vec3(1.f, 0.f, 0.f));

mat = glm::rotate(mat, glm::radians(m_fRotPitch), glm::vec3(0.f, 1.f, 0.f));

gluLookAt(

mat[0].x, mat[0].y, mat[0].z,

target.x, target.y, target.z,

up.x, up.y, up.z);

But, I don't know where i have to fix.

May you think that I don't understand both matrix and vector.

That's right. My knowledge on these is not enough.

So, Can't anybody help me understand concepts and what i misunderstand.

I wish to grasp these concept, then I could write and complete this program with Euler and Quaternion.

Any reference site/URL would help me.

Thank you in advance. ]]>

i'm working on a 3D viewer using the .msh file format. I would like that after opening a file the first time, the optimal position for the camera is calculated. The optimal position for me is: looking at 0,0,0 and moving as long as needed in -z direction to see everything.

Is there a way to calculate that distance??

For those who wanna take a look at the files: https://git.rwth-aachen.de/carstenf/...hViewer/Source ]]>

https://www.opengl.org/discussion_bo...etal-animation it's a few years old but it really helped me.

I have a very similar issue in that I can't get the correct matrices and apply it to my opengl project which is a basic collada viewer also this is not for homework and I have no training in this I am just doing this for hobby work but I can't seem to grasp what is happening. I have read many sources and read Dark Photon's reply many times as it has made good sense but its not working likely due to my misunderstanding of some fundamental concept.

I am going to do my best to explain my issue as clearly as I can using the terms that Dark Photon used (or at least my understanding of them).

So the first thing I am doing is extracting the inverse bind matrices (IBM) from the controller section of Collada file.

Now am I right in saying that for a basic example I could simply inverse the IBM to get the joints world matrix? To me that makes sense perhaps this is wrong, but in these collada files the rest pose will be the same as the bind pose.

Viewing the bone locations and mesh every thing looks good so I assume this part is correct, next I take the Animation Matrices (A) in from the animation section of the collada document.

And I multiply as follows (working on a bone with 1 parent)

G = (ParentBone.JointWorldMatrix * AnimationMatrix) * (ThisBone.JointWorldMatrix * AnimationMatrix)

In the above I am assuming that the animationMatrix is different for both multiplications? As in the multiple the parentbone.JWM by its animation matrix for this frame?

Then I get the Inverse Bind Pose of this bone

IBP = (ThisBone.IBM * ParentBone.IBM)

Then I calculate the Final Transformation

Could I please get a definition for what exactly this is doing?

Is it the transformation from 0,0,0? If not what is it from / to

F = G * IBP

And I get an unexpected result likely due to not fully understanding one for the matrices above or maybe something wrong with the whole process.

Also some other questions:

What is the animation matrix exactly? Is it how to animate the bone in the bone's local space (bone-space/joint-space)? ]]>

I'm looking for some informations about a test I want to perform. First I render the depth from the camera point of view and then, I need to project this texture into the light image space, any clue of how to do this projection ?

Thank ! ]]>