Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
H3D.org Feeds


Browsing this Thread:   1 Anonymous Users






FrameBufferTextureGenerator stereo problem
#1
Quite a regular
Quite a regular


See User information
Hello!

We have found some problem with using the FrameBufferTextureGenerator node.
It seems like when chaining several of these together there are some problems
with the stereo-rendering on certain positions combined with certain
orientations of the viewpoint.

As a example we have implemented a Bloom effect by rendering the scene to a
texture, extracting the bright parts of this texture, blurring the bright
parts of the texture and then finally combining the blurred texture with the
original. This required three FrameBufferTextureGenerator nodes chained together.

We noticed then that the stereo stopped working with the position [-0.1; 0; 0.8]
and the orientation [0; 1; 0; -0.25]. Changing the position to [0; 0; 0.8] or
changing the orientation to [0; 1; 0; 0.251] got it working again.

By setting the stereo mode to Vertical Split in H3DViewer we noticed that with
the non-working position and orientation the left side doesn't render.
Investigating further with the FBODebugger node we noticed that this doesn't
happen in the first FrameBuffer but in all following FrameBuffers.

Do you have any idea why this might be happening? Are there some easy solutions to this problem?

Specs:
OS: Windows 7
Graphics card: NVIDIA GTX 960
H3D 2.3

Posted on: 3/1 15:04
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: FrameBufferTextureGenerator stereo problem
#2
Just can't stay away
Just can't stay away


See User information
hi,

I tested here with a small example to chain three FBTGs nodes to try to reproduce your issue but without success.
Here is the example i am using:
<Scene>
    <
Viewpoint position='-0.1 0 0.8' orientation=' 0 1 0 -0.25' />

    <
Group>
      <
FrameBufferTextureGenerator DEF="GEN" outputTextureType="2D" generateColorTextures="RGBA" >
        <!-- 
Scene to render to texture -->
        <
Shape>
          <
Appearance>
            <
Material diffuseColor="1 0 0" />
          </
Appearance>

          <
Box size="0.2 0.2 0.2" />
        </
Shape>
      </
FrameBufferTextureGenerator>
      <
FrameBufferTextureGenerator DEF="GEN1" outputTextureType="2D" generateColorTextures="RGBA">
        <
Shape>
          <
Appearance DEF="APP1" >
            <
Material/>
            <
MultiTexture DEF="MT1" />
          </
Appearance>
          <
FullscreenRectangle screenAligned="true" />
        </
Shape>
      </
FrameBufferTextureGenerator>
      <
ROUTE fromNode="GEN" fromField="colorTextures" toNode="MT1" toField="texture" />
      
      <
FrameBufferTextureGenerator DEF="GEN2" outputTextureType="2D" generateColorTextures="RGBA">
        <
Shape>
          <
Appearance DEF="APP2" >
            <
Material/>
            <
MultiTexture DEF="MT2" />
          </
Appearance>
          <
FullscreenRectangle screenAligned="true" />
        </
Shape>
      </
FrameBufferTextureGenerator>
      <
ROUTE fromNode="GEN1" fromField="colorTextures" toNode="MT2" toField="texture" />
      
      <!-- 
Shape for rendering depth texture on -->
      <
Shape>
        <
Appearance DEF="APP" >
          <
Material/>
          <
MultiTexture DEF="MT" />
        </
Appearance>
        <
FullscreenRectangle screenAligned="true" />
      </
Shape>
    </
Group>

    <
ROUTE fromNode="GEN2" fromField="colorTextures" toNode="MT" toField="texture" />
</
Scene>


I am testing with the trunk.

Could you also test with my example. Also it is better if you can provide an example to reproduce your issue.

Mvh
Hao

Posted on: 3/2 11:38
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: FrameBufferTextureGenerator stereo problem
#3
Quite a regular
Quite a regular


See User information
Thank you for your reply, I will test your example and reply with an example that describes our problem better.

Posted on: 3/6 12:25
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: FrameBufferTextureGenerator stereo problem
#4
Quite a regular
Quite a regular


See User information
Hi again,

We get some problems with your example as well, not at the same orientation and position through.
While using the mouse to rotate the scene we noticed that again at times the left and/or the
right buffer (using Vertical split) doesn't render correctly. See attached screenshot: frame_buffer_problem.jpg

Since we are using the 2.3.0 release from the default release we guess that the problem has been fixed along the development...
but it would be nice if you test our example as well to make sure

Below is our x3d file (with the scene exchanged to the same box as your example):
<Scene>

<
FrameBufferTextureGenerator DEF="GEN" outputTextureType="2D" generateColorTextures="RGB16F" generateDepthTexture="true">
    <
Shape>
          <
Appearance>
            <
Material diffuseColor="1 0 0" />
          </
Appearance>

          <
Box size="0.2 0.2 0.2" />
        </
Shape>
</
FrameBufferTextureGenerator>

<
FrameBufferTextureGenerator DEF="BRIGHT" outputTextureType="2D" generateColorTextures="RGB16F">
    <
Shape>
        <
Appearance DEF="APP" >
            <
ComposedShader DEF="BRIGHT_SHADER" language="GLSL">
                <
field name="hdrBuffer" type="SFNode" accessType="inputOutput">
                    <
ImageTexture/>
                </
field>
                <
ShaderPart type="VERTEX" url="../../shaders/passthrough.vert" />
                <
ShaderPart type="FRAGMENT" url="../../shaders/bright.frag" />
            </
ComposedShader>
        </
Appearance>
        <
FullscreenRectangle screenAligned="true" />
    </
Shape>
</
FrameBufferTextureGenerator>

<
FrameBufferTextureGenerator DEF="BLURRED" outputTextureType="2D" generateColorTextures="RGB16F">
    <
Shape>
        <
Appearance DEF="APP" >
            <
GaussianFilterShader DEF="BLUR" type="FULL" sigma="100000" kernelSize="7" pixelStepOffset="1"/>
        </
Appearance>
        <
FullscreenRectangle screenAligned="true" />
    </
Shape>
</
FrameBufferTextureGenerator>

<
Shape>
    <
Appearance DEF="APP" >
        <
ComposedShader DEF="FINAL" language="GLSL">
            <
field name="hdrBuffer" type="SFNode" accessType="inputOutput">
                <
ImageTexture/>
            </
field>
            <
field name="blurBuffer" type="SFNode" accessType="inputOutput">
                <
ImageTexture/>
            </
field>
            <
field name="depthBuffer" type="SFNode" accessType="inputOutput">
                <
ImageTexture/>
            </
field>
            <
field name="exposure" type="SFFloat" accessType="inputOutput" value="2.0"/>
            <
ShaderPart type="VERTEX" url="../../shaders/passthrough.vert" />
            <
ShaderPart type="FRAGMENT" url="../../shaders/final.frag" />
        </
ComposedShader>
    </
Appearance>
    <
FullscreenRectangle screenAligned="true"/>
</
Shape>

<
ROUTE fromNode="GEN" fromField="colorTexture" toNode="BRIGHT_SHADER" toField="hdrBuffer"/>
<
ROUTE fromNode="BRIGHT" fromField="colorTexture" toNode="BLUR" toField="texture"/>
<
ROUTE fromNode="GEN" fromField="colorTexture" toNode="FINAL" toField="hdrBuffer"/>
<
ROUTE fromNode="BLURRED" fromField="colorTexture" toNode="FINAL" toField="blurBuffer"/>
<
ROUTE fromNode="GEN" fromField="depthTexture" toNode="FINAL" toField="depthBuffer"/>

<
FBODebugger/>

</
Scene>


Passthrough.vert:
void main() {
      
gl_Position gl_ModelViewProjectionMatrix gl_Vertex;
      
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
}


Bright.frag:
uniform sampler2D hdrBuffer;

void main(void)
{
    
vec3 hdrColor texture(hdrBuffergl_TexCoord[0].st).rgb;
    
float brightness dot(hdrColor.rgbvec3(0.21260.71520.0722));

    if (
brightness 1.2)
    {
        
gl_FragColor vec4(hdrColor1.0);
    }
}


Final.frag:
uniform sampler2D hdrBuffer;
uniform sampler2D blurBuffer;
uniform sampler2D depthBuffer;
uniform float exposure;

void main(void)
{
    
vec3 hdrColor texture(hdrBuffergl_TexCoord[0].st).rgb texture(blurBuffergl_TexCoord[0].st).rgb;
    
vec3 result vec3(1.0) - exp(-hdrColor exposure);

    
gl_FragDepth texture(depthBuffergl_TexCoord[0].st).r;
    
gl_FragColor vec4(result1.0);

}

Attach file:



jpg  frame_buffer_problem.jpg (14.84 KB)
11257571_58c00384d2527.jpg 776X516 px

Posted on: 3/8 14:17
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: FrameBufferTextureGenerator stereo problem
#5
Just can't stay away
Just can't stay away


See User information
Hello,

I tested your example with the trunk version, it works all fine in stereo version. Also, i rechecked the example i provided with various orientations, it still looks fine with trunk version.

So , it is very likely an issue in release 2.3 which get resolved later. I highly recommend you to try the trunk version

Posted on: 3/9 18:29
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top







You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create pdf.
You cannot get print page.

[Advanced Search]





(C) 2012 SenseGraphics AB    ---    Powered by XOOPS