Hi,
I have problems with this topic.
I get my View Matrix by viewer-getCamera()-getViewMatrix() and apply a
rotation by preMult, but the camera rotates using the center of the world scene
as reference, not its own center.
How I can do this?
...
Thank you!
Cheers,
Rômulo
--
Hi Sebastian,
I followed your tip and passed the reflectance as float-uniform. Each object
has a different reflectance passed by individual statesets.
...
Thank you!
Cheers,
Rômulo
--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=69791#69791
Hi Sebastian,
>
> There is no direct way. If you need shaders with and without texturing
> you should bind different programs to the affected geometries.
>
I think my problem is a little bit different. I will receive the final scene
with or without textures and process it properly. I
Hi Sebastian,
I have used the last openscenegraph stable package in ubuntu (version 3.2.3 -
https://launchpad.net/ubuntu/+source/openscenegraph), and there is no
setDefine() method in osg::StateSet (only for 2.4 and newer). There is a
different way?
Cheers,
Rômulo
--
Read
Hi,
>
> I can create a minimal example if you're stuck with this.
>
I will appreciate this, please.
...
Thank you!
Cheers,
Rômulo
--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=69845#69845
Hi Christian,
> You could traverse the scene graph and check the state sets to see if they
> bind a texture to a texture unit.
>
> Then depending on these findings, choose the correct shader code.
I appreciated it. Can you give me some example?
...
Thank you!
Cheers,
Rômulo
Hi,
I have simulated a sonar sensor using normal depth map by custom 3D shader from
OpenSceneGraph scene.
I already implemented the Bump Mapping technique to change the normal
directions. For now, I need to change the material properties (e.g.
reflectance) of scene's objects to
Hi,
is there a way to check if a texture (as uniform sampler2D) is valid in
fragment shader?
This is my current code:
Code:
if (textureSize(myTexture, 0).x > 1) {
// do something with the texture
}
else {
// process without texture information
}
...
Thank you in advance!
Cheers,
Rômulo
Hi Sebastian,
>
> Are you planning on using the bump-maps alpha channel, or which alpha do you
> plan to use.
>
I wanna to pass a reflectance value to be multiplied by the normal map
(normNormal in fragment shader) to simulate real situations. For example, a
steel cube (e.g. reflectance =
Hi SMesserschmidt,
Thanks for your reply. I wanna set a refletance value for each scene's object
and multiply it by normal value (e.g. Steel and aluminium have more
reflectivity than wood and plastic). In this case, the alpha channel will
change the object transparency, right? If yes, I think
Hi SMesserschmidt,
Thanks for your reply. I wanna set a refletance value for each scene's object
and multiply it by normal value (e.g. Steel and aluminium have more
reflectivity than wood and plastic). In this case, the alpha channel will
change the object transparency, right? If yes, I think
Hi Sebastian,
I was having a look in the second option and it is easy to code
(https://www.opengl.org/sdk/docs/tutorials/ClockworkCoders/uniform.php),
however I'm not sure if I can set different reflectance in a scene with
multiple objects. Maybe use the alpha channel is a better option.
...
Hi Sebastian,
this is my vertex shader:
Code:
#version 130
out vec3 pos;
out vec3 normal;
out mat3 TBN;
void main() {
pos = (gl_ModelViewMatrix * gl_Vertex).xyz;
normal = gl_NormalMatrix * gl_Normal;
vec3 n = normalize(normal);
vec3 t = normalize(gl_NormalMatrix[0]);
vec3 b = cross(t, n);
Hi,
I like to change the current perspective view of my camera to an orthogonal
projection, keeping the same position. How can I do this?
My current code of perspective camera:
Code:
_viewer->getCamera()->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);
Hi Robert,
thanks for your reply. Follows my code:
Code:
#define BOOST_TEST_MODULE "NormalMapping_test"
#include
// OpenSceneGraph includes
#include
#include
#include
#include
#include
#include
#include
#include
// Rock includes
#include
#include
// OpenCV includes
#include
Hi Trace and Nick,
this attachment is my output when I perform the following commands:
Code:
export OSG_NOTIFY_LEVEL=DEBUG
osgviewer --image gray_texture_d.jpg
...
Thank you!
Cheers,
Rômulo
--
Read this topic online here:
Hi Nick and Robert,
the attached file is the output from my C++ program. Any suggestions to solve
that?
Thanks in advance,
Rômulo Cerqueira
--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=71407#71407
Attachments:
http
Ok Robert,
this is my current code (only .cpp):
Code:
#include "ImageViewerCaptureTool.hpp"
#include
#include
#include
namespace normal_depth_map {
ImageViewerCaptureTool::ImageViewerCaptureTool(uint width, uint height) {
// initialize the hide viewer;
initializeProperties(width,
Hi,
I have the following message when I run my OSG application:
Code:
CullVisitor::apply(Geode&) detected NaN,
depth=nan, center=(1.79588 1.50488 1.42179),
matrix={
nan nan -nan -nan
nan nan -nan -nan
nan nan -nan -nan
nan nan -nan -nan
}
What this kind of warning/error means?
...
Hi guys,
I found and solved the problem! :D
When I grab the osg scene at first time, my view matrix is NaN; from the second
time, this matrix is correctly filled.
Then, I modified the grabImage method to replace when the view matrix is NaN by
the identity matrix, as follows:
Code:
Up!
Rômulo
--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=71574#71574
___
osg-users mailing list
osg-users@lists.openscenegraph.org
Hi,
I would like to use the dynamic cubemaps to reproduce the mirror effects in my
application, however I found few examples on the internet.
Is there any example code related to this topic? I will appreciate that.
...
Thank you!
Cheers,
Rômulo
--
Read this topic online
Hi,
I would like to use the dynamic cubemaps to reproduce the mirror effects in my
application, however I found few examples on the internet.
Do you have any code about dynamic cubemaps to suggest me?
...
Thank you!
Cheers,
Rômulo
--
Read this topic online here:
Hi Nick,
I still need help to get the normal/depth data from reflected objects. Could
you have a look in my current code?
C++ code:
Code:
// OSG includes
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
// C++ includes
Hi,
I got the depth data from reflected objects. I needed to render the depth
buffer to texture. Follows my update code:
C++ code:
Code:
// OSG includes
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
// C++ includes
Hi Sebastian,
can you help me to find an example? I've been looking for this solution for
almost two months.
...
Thank you!
Cheers,
Rômulo
--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72612#72612
Hi,
is it possible to generate dynamic cubemaps (with normal mapping textures)?
...
Thank you!
Cheers,
Rômulo
--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72606#72606
___
osg-users mailing
Follows attached my output info when OSG_NOTIFY_LEVEL = DEBUG.
...
Thank you!
Cheers,
Rômulo
--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72310#72310
Attachments:
http://forum.openscenegraph.org//files/debug_596.txt
Hi Christian and Robert,
I solved in an alternative way: converting my images to PNG. I did not change
anything in the source code and it worked!
...
Thank you!
Cheers,
Rômulo
--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72323#72323
Hi,
I have used normal mapping using GLSL and OSG for my application (an imaging
sonar simulation) and I got problems by calculating the TBN matrix on shaders.
The normal vectors contain lower resolution on border in comparison with the
center of image.
Follows my vertex code:
Code:
Hi Jordi and Sebastian,
thanks for your replies. I will have a look on osg::TangentSpaceVisitor,
however I have a question: I will have in my OSG scene a lot of objects
with/without normal mapping. How can I handle different normal textures using
the same osg::TangentSpaceVisitor?
...
Thank
Hi community!
I got some problems by loading JPG images using OSG.
When I read them directly using osgviewer, the images are loaded with success.
Code:
osgviewer --image /home/romulo/gray_texture_n.jpg
However, the problem occurs when I read the images by OSG code, as presented in
my
Thanks a lot, Nick.
I will have a look in this source code. If I have some doubts, I will ask.
...
Thank you!
Cheers,
Rômulo
--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72552#72552
___
Thanks a lot, Robert!
Do you have some example with dynamic cube map with OSG and GLSL?
...
Thank you!
Cheers,
Rômulo
--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72540#72540
___
osg-users
Hi Robert,
my idea is to compute the secondary reflections by using dynamic cubemap. I
need to get the normal and depth from cube map reflections. Is it possible?
...
Thank you!
Cheers,
Rômulo
--
Read this topic online here:
Hi Nick,
how can I encode the normal and depth data in the env texture?
...
Thank you!
Cheers,
Rômulo
--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72565#72565
___
osg-users mailing list
Hi Nick,
I have a deep look in your code and I have a doubt.
The cube mapping results provides the reflected color. Is it possible to get
the normal and depth instead of the reflected color?
Best regards,
...
Thank you!
Cheers,
Rômulo
--
Read this topic online here:
Folks!
Any tips here?
Thanks in advance,
Rômulo
--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=73636#73636
___
osg-users mailing list
osg-users@lists.openscenegraph.org
Hi Robert,
thanks for your reply. Nowadays this topic is outdated. I will create a new
topic in OSG forum and explain better the scenario. Thanks for the tip.
...
Thank you!
Cheers,
Rômulo
--
Read this topic online here:
iewMatrix( osg::Matrixd::identity() );
postRenderCamera->setProjectionMatrix( osg::Matrixd::identity() );
postRenderCamera->addChild( geode );
root->addChild(postRenderCamera);
// setup the callback
SnapImage* finalDrawCallback = new
SnapImage(viewer.getCamera()->get
Hi Sebastian and Julien,
thanks for your comments. I tried your suggestions without success, even output
image in different formats (BMP, PNG, TIFF...). It is funny, because I can
handle the image data as GL_FLOAT, but the image is only properly written in
disk as UNSIGNED_BYTE.
At this
Hi,
just updating my progress:
What have I got so far?
[ ✓ ] Allow rendering for color or depth buffers on the same camera;
[ ✓ ] Display only the color buffer in the post render camera;
[ ✓ ] Read color or depth buffer in the final draw callback;
[ ✗ ] Write collected image (color or depth) in
botics/simulation-normal_depth_map/blob/master/src/ImageViewerCaptureTool.hpp
- ImageViewerCaptureTool.cpp:
https://github.com/Brazilian-Institute-of-Robotics/simulation-normal_depth_map/blob/master/src/ImageViewerCaptureTool.cpp
Thanks in advance,
Rômulo Cerqueira[/url]
--
Read this
Hi Sebastian,
I believe copying and pasting code is not the case here. I have read a lot
about MRT, RTT and FBO and debugged some source code examples (including your
hints), however I still have problems in my side to compute the normal.
So let's go to new doubts:
- In Kapelko's example, if I
Moreover, I installed the openscenegraph-examples package (using Ubuntu),
however the osgdeferred example does not contain all complementary data (i.e.
data/shaders/simpleShader01, data/shaders/colorTextureShader and
data/shaders/lightingPass).
I could not find these shader codes in
Hi,
I still have problems to manage the normal view from reflected objects (using
dynamic cubemaps technique). Please any tip here?
...
Thank you!
Cheers,
Rômulo
--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72885#72885
Hi Sebastian,
thanks for all comments. Do you know how I can manage these six faces of
cubemap? I can handle all faces using one texture or I need to create six
textures?
I really need help with this...It's essential to my project.
...
Thank you!
Cheers,
Rômulo
--
Read this
Hi Sebastian,
I have managed the normal and depth using MRT-FBO. I changed the osgdeferred
example to display the normal (blue) and depth (green). Now I need to repeat
this process for each six faces of cubemap.
I have a question: to capture the normal/depth data, as seen in Figure, I used
Hi Roberto and Sebastian,
sorry for my duplicated post. I need to render the depth/normal surface to
texture of reflected objects by cube maps.
Until this moment, I got the depth data. Could you help me to get the normal
data too (as single channel data). My current code follows below:
C++
Hi,
I would like to write the output/buffer of fragment shader to texture (RTT) as
I wish (e.g. all red), however this result is depending of the model's shapes
visible in the scene. How can I proceed with this correctly?
Follow below my minimal source code and the results.
Thanks in advance!
Hi Johny,
I would like to draw what I want... the red was just an example.
My main goal is to simulate the reverberation phenomena using rasterization
(for the first reflection) + ray tracing (for the second reflection). I would
like to output the surface of reflected scenes, which are always
Folks,
is there any example to implement FBO without cameras? Where can I find it?
...
Thank you!
Cheers,
Rômulo
--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=73488#73488
___
osg-users mailing
Hi,
I found a way to solve this problem: converting the array to texture.
Follows an example:
Code:
osg::ref_ptr image = new osg::Image;
image->setImage(myVec3Array->size(), 1, 1, GL_RGBA8, GL_RGBA, GL_FLOAT,
(unsigned char*) [0], osg::Image::NO_DELETE);
osg::ref_ptr texture = new
Hi,
can I pass a osg::Vec3Array as uniform to Shader?
...
Thank you!
Cheers,
Rômulo
--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=73010#73010
___
osg-users mailing list
Thanks, Robert.
...
Thank you!
Cheers,
Rômulo
--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=73022#73022
___
osg-users mailing list
osg-users@lists.openscenegraph.org
Hi,
I have tried to read image from RTT (where the image is "not attached", but
available on buffer) using a osg::Camera::DrawCallback, the compilation is
working, however the executable brings me a segmentation fault during image
rendering. How can I solve this?
Code:
Hi Martin,
I never faced with this problem. Do you have some tip to solve it?
...
Thank you!
Cheers,
Rômulo
--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74984#74984
___
osg-users mailing list
Solved the problem!
Perhaps readImageFromCurentTexture() works only with osg::ref_ptr
instead of osg::Image*.
...
Thank you!
Cheers,
Rômulo
--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74986#74986
Hi Robert,
I use the method setupViewer() "to resize" the FBO as well (by instantiating
the viewer, camera, texture and callback again). This approach was the best way
so far to minimize this problem.
...
Thank you!
Cheers,
Rômulo
--
Read this topic online here:
Hi,
> So you are setting a whole new graphics context and associated data on
> each resize?
Yes, Robert.
...
Thank you!
Cheers,
Rômulo
--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=75019#75019
Hi Robert,
I use the method setupViewer() "to resize" the FBO as well (by instantiating
the viewer, camera, texture and callback again). This approach was the best way
so far to minimize this problem.
...
Thank you!
Cheers,
Rômulo
--
Read this topic online here:
> Is it only the FBO that is forcing you to do this?
Yes.
Do you have any tip how can I solve this issue?
I found similar problems into links below, but I could not have the same
success.
https://groups.google.com/forum/#!topic/osg-users/Oxb9QF8Myyo
Hi,
I have rendered a FBO camera to image by using a callback (as seen in the code
below), however some OpenGL warnings/erros are raised when I resize at runtime
by setupViewer() method. I debugged the code by using
Code:
export OSG_GL_ERROR_CHECKING=ON
and got the following error:
63 matches
Mail list logo