Hi,
to me this looks like a driver implementation specific problem. I would guess
that the nVidia driver only allocates enough memory for the first mipmap-level
on the first glTexImage2D. On the second glTexImage2D call it reallocates
memory for all mipmap-level and copies the first level to
Hi,
I am currently evaluating different Level Of Detail techniques for my masters
thesis. One of them is the relatively new Pop Buffer(http://x3dom.org/pop/)
technique.
A short summary how the technique works:
* Vertex clustering is used to simplify the input geometry. This is implemented
by
Hi,
I think I found the source of this bug. There is a Linux specific detail in the
pthreads API:
The new thread inherits copies of the calling thread's capability sets (see
capabilities(7)) and CPU affinity mask (see sched_setaffinity(2)).
This can be found in the man page of
Hi,
the shadow on the wall is probably created, because the wall is outside of the
shadow cameras view frustum. How do you setup the wrapping of your depth
texture? You could fix it, if you set the mode to clamp to border and set the
border color to your far plane. This way everything that
Hi,
the matrix multiplication in OpenSceneGraph works in reverse order.
Normally(for example in the shader) MVP = Projection * View * Model is the
right order, but in OSG its the other way arround.
If you get the same results for View * Projection and Projection * View, one of
your matrices is
Hi,
it is a bit complex to explain in detail how the projection matrix transforms
depth values. In short: the depth is linearized to [0,1] with the near and far
plane and after this multiplied with a depth-dependent factor, so that near
values take up more space in the depth range than far
Hi,
this line seems to be wrong:
Code:
float depth = texture2D(shadowMap, shadowTexCoord.x/2 + 0.5, shadowTexCoord.y/2
+ 0.5).z;
it should be
Code:
float depth = texture2D(shadowMap, vec2(shadowTexCoord.x/2 + 0.5,
shadowTexCoord.y/2 + 0.5)).x;
Additionally you compare the depth from
Hi,
you write the depth in your first texture component(accessed from the shader
with .r, .x or .s). But you read it from the third component of your
texture(.z). I know it looks confusing at first to read the depth from .x, but
this is actually right.
Thank you!
Cheers,
Marcel
Hi,
No shadow with 0,0,1 is a bug. I'm not sure where ist comes from.
The length in the shader was a test I forgot to revert this change.
-viewspacePosition.z shold be used instead in both cases.
1000.0 is my far plane, i write the depth value unormalized [near, far].
Thank you!
Cheers,
Marcel
Hi,
In your current implementation you store your fragment positions in world space
and use them for lighting in the final fragment shader.
If you pass a matrix uniform to this pass, that translates from world space to
screen space of the light pass, you can calculate your shadow texcoords.
So
Hi,
shadow mapping is a projective texturing approach. A good methaphor to explain
it is that from the light source a slide projector is casting the depth buffer
on your scene. For this to work you need to do two things:
1. create your depth buffer with screenspace coordinates(the screenspace
Hi,
your other buffers use the rectangle format. This texture format can be accesed
with unormalized coordinates [0, texturesize]. Regular 2D textures need to be
accessed with normalized texture coordinates [0, 1].
Thank you!
Cheers,
Marcel
--
Read this topic online here:
Hi,
I think the used data type for the depth texture is set wrong. A depth buffer
does not use a floating point type but a fixed point type.
When you access the texture in a shader you get values in the range of [0,1].
But it is stored as a 24 bit integer value in the texture. Just like a RGBA8
Hi Sebastian,
I never tested the color buffer approach for simple shadow mapping without
filtering. I only used it to implement variance shadow mapping(a GL_RG32F
texture stores the mean depth value and the variance). The implementation was
significantly faster than percentage closer filtering
Hi Sebastian,
But in case one is writing to the attached depth target (e.g. a linear
depth value) the hierachical culling should be gone AFAIK.
Well my idea was to write to the regular color buffer target. The depth target
is unaffected. It will still use the logarithmic depth value and
Hi Sebastian,
But in case one is writing to the attached depth target (e.g. a linear
depth value) the hierachical culling should be gone AFAIK.
Well my idea was to write to the regular color buffer target. The depth target
is unaffected. It will still use the logarithmic depth value and
Hi,
I don't know if you already found the solution to your problem, but this is how
you can calculate the camera position in worldspace:
Code:
vec4 cameraPos_wordspace = osg_ViewMatrixInverse * vec4(0.0, 0.0, 0.0, 1.0);
The rotation and scale factors can be found in the first three rows
Hi,
your comments are looking good so far. A good name for the posDir_worldspace
would be view direction or eye direction. In most lighting formulas it is
abbreviated with V or E. It is the direction from the vertex to the eye/camera.
There are good wikipedia articles that explain the
Hi,
your right, this part of the shader code is wrong. This direction needs to be
calculated:
Code:
posDir_worldspace = normalized(camera_worldspace-p_worldspace);
The way it is done in the shader only works for viewspace positions, as the
camera position is always 0,0,0 in viewspace
Hello,
I can't give you a example code but a general concept.
The most commonly used technique to create shadows nowadays is shadow mapping.
The basic idea is to render in a depth buffer from the light source looking to
the scene. The projection and model view matrix, that was used to generate
Hello Daniel,
what kind of graphics card are you using? ATI/AMD? And are you using a vertex
shader for your terrain? I had a similiar problem with reflections in osgOcean.
The solution was to add the line gl_ClipVertex = gl_ModelViewMatrix *
gl_Vertex; to my vertex shader. On nVidia cards this
Hi,
it looks like the driver in your virtual machine does not support OpenGL =2.0.
The function pointers for some newer features can not be found. So things like
shaders, occlusion queries, framebuffers and instancing will not work.
If fear there is nothing much you can do about that. You can
Hi,
according to the homepage of VMWare they support DirectX 9.0 and OpenGL 2.1 and
VirtualBox has DirectX 9.0 and OpenGL(no version mentioned) support.
So hardware accelaration should work, if a new version of VMWare or VirtualBox
is used.
Thank you!
Cheers,
Marcel
--
Read
Hi Aurelien,
Thank you, for your answer. I suspected something like this, but I was not sure
if I was right. It looks like I am using the cache for the uniform buffers in a
very bad way, because I change the data so often.
As you suggested I'm currently trying out storing the matrices in a
Hi,
I am currently evaluating the performance of uniform buffer objects vs. regular
uniforms. My demo applications uses hardware instancing to render thousands of
quads that represent grass. The geometry is static in my demo.
I tried out different approaches to store the model matrix for each
Hi,
I tested it on a nVidia GTX670, driver version 314.22 for Windows 7 x64.
Thank you!
Cheers,
Marcel
--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=56011#56011
___
osg-users mailing list
Hello dear OSG-community,
I want to present you my new blog Advanced 3D Computer Graphic Tutorials
(http://3dcgtutorials.blogspot.de/). It could be interesting to some of you.
Among other topics, there will be some tutorials for OpenSceneGraph. The
tutorials are not meant as an introduction to
Hello John,
thank you for providing Visual Studio 2012 binaries, this saves me alot of time.
I have noticed that the link for the 3.2.0 includes is broken. I made an
educated guess and tried
http://www.helleboreconsulting.com/downloads/OpenSceneGraph_v3_2_0_Includes.zip
and it worked. So
Hello Robert,
thank you for your help. Using mutliple RTT Cameras worked, but I went back to
using just a single one. Executing mutliple read backs per frame had a huge
impact on the performance.
I just changed inherhitance mask of the read back camera that it doesn't
inherit the cull mask.
Hi,
I'm currently having a problem in understanding, when the PreDrawCallback and
PostDrawCallback of a camera are called. I'm working on a project where Virtual
Texturing and Depth Peeling is used.
For Virtual Texturing the following steps are necessary:
1. Render whole scene with special
Hi,
I found the cause of the problem myself. When the scene graph is traversed a
osgUtil::RenderStage is created for the camera and added to the RenderCache of
the camera. So only one RenderStage per CullVisitor is created. When the
RenderStage is drawn it sets a flag that is was already drawn
Hi,
after reading some of the commit messages it looks like not all necessary api
methods are integrated in OpenSceneGraph right now. glMemoryBarrier for example
is not called anywhere but necessary to make sure all data is written to the
image before starting the next rendering stage.
So my
Hi,
I recently checked out the newest development release of OSG (version 3.1.5).
After playing around with the osgatomiccounter and osgcomputeshader examples I
tried to implement order independent transparency with per pixel linked lists
as mentioned in this presentation: click!
Hi,
Thank you for your response. To be honest your raw OpenGL example was the first
I have found, when I was searching for an implementation of this technique. It
gave me the idea to implement it with OpenSceneGraph right now ;)
As far as I can see you are using nVidia specific extensions in
34 matches
Mail list logo