Hello.
I am working on osgPPU but there are some things i haven't completely
understood yet.
I add 2 children in root's group.
A cow model and the osgPPU::Processor.
In processor i have added 1 child which outputs the depth buffer and under
that child i have added 1 child which outputs to frame
Hello
In osgppu_ssao project in simple.h file, there are the following lines:
shader-add(originalDepthTexture, osg::Uniform::SAMPLER_2D);
shader-set(originalDepthTexture, 1);
Where is the depth texture associated with texture unit 1 ?
i couldnt find it anywhere.
thnx.
Hello.
This is what i use for depth texture creation:
osg::Texture2D* texture2D = new osg::Texture2D;
texture2D-setTextureSize(tex_width, tex_height);
texture2D-setInternalFormat(GL_RGBA);
texture2D-setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR);
Hello.
Is there any difference between these 2 or are they different
implementations for the same purpose ?
For someone who wants to support multi passes (using shaders) on model
nodes which is better ?
thnx.
___
osg-users mailing list
Hello.
Is it possible to retrieve the normal map using osgPPU ?
I have used the following shaders and a blue screen appears.
Vert
---
varying vec3 normal;
void main(void){
gl_Position = ftransform();
normal = gl_NormalMatrix * gl_Normal;
}
Frag
---
varying vec3 normal;
void
Hello.
in the example osgmultiplerenderingtargets, why are the texture
coordinates initialized as:
0, 0
tex_width, 0
tex_width, tex_height
0, tex_height
instead of
0,1
1,0
1,1
0,1
(the result is different)
Thank you for your time.
___
osg-users
Hello.
What's the difference between COLOR_BUFFER and COLOR_BUFFER0 ?
In case i want to use COLOR_BUFFER0 in frag shader, i use gl_FragData[0].
What about COLOR_BUFFER ?
And last question, in case i dont use FBO, why writting gl_FragData[0] to
fragment shader gives us the correct result ?
Hello.
First of all sorry if the next question is dumb but i couldnt find it
anywhere.
I use camera-attach(osg::Camera::COLOR_BUFFER0, textureColor); in my
program.
It works only if the texture's source format is GL_RGBA.
As i read in setSourceFormat's comment: Sets the external source image
Ok found it... I just had to write to image in post camera callback...
nothing more.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Hello.
My task is to have 2 cameras being exactly the same.
The first one will render to my window and the second one to texture.
First i tried to create a camera as child to scene data and add the same
model as child.
So i used the following code:
Viewer viewer;
Camera* camera = new
Hello.
I add to the viewer the following scene graph:
Group
MyEffect
Model
MyCamera
Model
The effect uses a 2 pass technique.
In the first pass i render to texture the contents of color buffer 0 using
MyCamera.
In the second pass, i use the previous texture and i render
Hello.
What osgFX::Registry::Proxy proxy(new MyEffect); does ?
Couldnt find any reference anywhere. i see it is used in predefined Effects
like Outline.
thnx.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
Hello.
I assume you have the code of OSG.
Go to svn\OpenSceneGraph\src directory and search all *.cpp files for the
gl function you want.
thnx.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
Hello again.
Forgot to mention this picture is the result of
float depth_value = gl_FragCoord.z;
gl_FragData[0] = vec4(depth_value, depth_value, depth_value, 1);
This is how i try to export the depth texture.
thnx again.
___
osg-users mailing list
Not sure if the different levels of depth are distinguishable in first image.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Hello.
I use this method: http://www.john-chapman.net/content.php?id=8 for ssao pass.
For each fragment i create a hemisphere of samples. This hemisphere is
oriented based on fragment's normal, which means
the samples have to be oriented based on normal too.
The problem is that i cant be sure
Hello.
I try to create an algorithm which uses a configurable number of samples:
uniform vec3 sample_kernel[256];
When i use value higher than 502, i get some errors which probably
refer to my GPU (gtx 650).
It seems gl_MaxFragmentUniformComponents is 2048.
I try to use
Hello.
I try to turn off the lights in my scene using the following code but it fails.
group-getOrCreateStateSet()-setMode(GL_LIGHTING,
osg::StateAttribute::OFF || osg::StateAttribute::OVERRIDE );
When i use this though, the lights are turned off successfully.
Edit second sentence:
Now i try to use it in OSG.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Hello.
Thank you for your answer. I use collada format. I have run the model
using the osganimationviewer example.
i will try what you wrote.
thnx.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
Hello.
Inside OpenSceneGraph-Data i have create a folder with name mydata.
Even though the line:
ref_ptrNode node = osgDB::readNodeFile(mydata/model.dae);
loads the model, i cannot load shader files from the same directory.
The call shader-loadShaderSourceFromFile(fileName) fails.
The same
Hello.
I use the default RigTransformHardware for skinning on a dae Model
with skeleton.
My model consists of 4 RigGeometries (image 1). The number of bones
per vertex is 7, 2, 20 and 15 respectively.
After enabling the OSG_NOTIFY as INFO i see that it creates vec4
boneWeightX attributes based on
Hello
Here are the books + quick guide:
http://www.openscenegraph.com/index.php/documentation/books
And you can also download the source code of many examples using svn:
http://www.openscenegraph.com/index.php/downloads/code-repositories
thnx.
___
Hello.
Lets say there is cessna as a child in LightSource group.
LightSource has 1 light.
What i want to do is to get the depth map from light's point of view.
How can i do this ?
I am thinking of placing a Camera as a child in LightSource.
This camera will look at exactly the same direction as
Hello.
I have some questions based on osgSHadow::ShadowMap
1) I try to use the makeDebugHUD from ShadowMap class with
hudCamera-setComputeNearFarMode(osg::Camera::DO_NOT_COMPUTE_NEAR_FAR),
but
it doesnt work because in a scene with a movable cessna and a
non-movable truck, the
Hello.
Lets say i have a texture which stores the depthmap.
1) Is the following correct ?
texture2d-setInternalFormat(GL_DEPTH_COMPONENT16);
texture2d-setSourceFormat(GL_DEPTH_COMPONENT);
texture2d-setSourceType(GL_UNSIGNED_SHORT);
2) Why do we need do initialize both internal format and
Hello.
I want to use 2 different effects on the same model but i am not sure
if this is possible.
I have 2 multi pass render algorithms implemented in 2 different effects.
Can i have the following graph ?
Effect1
Effect2
Model
Knowing that the child's state overrides the parent's, i
Hello.
Thank you for your answer but it seems it doesnt work because with
this graph we have 2 models in the scene (one on top of each other)
I want my model to be affected by both effects (only 1 model in the scene).
thnx again.
___
osg-users mailing
Hello.
I have a camera which renders to osg::Camera::DEPTH_BUFFER using
camera-attach(osg::Camera::DEPTH_BUFFER, texture);
Here is how i create the texture:
texture-setInternalFormat(GL_DEPTH_COMPONENT);
texture-setSourceFormat(GL_DEPTH_COMPONENT);
Hello.
It was my mistake because i forgot that gl_TexCoord[0] was vec4.
I should use gl_TexCoord[0].xy.
thnx.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Hello.
Osg uses a coordinate system in which the +y axis goes into the screen
and +z axis goes up.
Does this default matrix affects the model matrix of each object on
the scene or the view matrix of all the cameras ?
I wish i could remove this behavior.
thnx.
Hello.
I try to create a multi pass algorithm and i am stuck.
I use my own view and projection matrix for an absoluted positioned camera.
But i cant figure out how to handle the World matrix.
Glsl gives me gl_ModelViewMatrix but i need only the model matrix for
the current vertex being processed.
Hello and thank you for your answer.
Why do i have to register the effect?
When i remove this line nothing is changed.
Isnt the following enough ?
ref_ptrMyEffect effect = new MyEffect(model.get());
effect-addChild(model.get());
group-addChild(effect);
The model has to be passed to MyEffect's
Hello.
Thank you for your answer, but there is a problem.
In the first pass algorithm, the value osg_ViewMatrixInverse is wrong.
It corresponds to the main camera instead of the RTT camera i use.
The variable gl_ModelViewMatrix is correct though. Any idea of what i
can do to pass the correct
Hello.
I try to obtain the world matrices using getWorldMatrices.
The graph is :
Group
Group
MatrixTransform
The object uses the following matrix as Matrix Transform:
1 0 0 0
0 1 0 0
0 0 1 2.5
0 0 0 1
But i still get 3 identity matrices.
When i add the object in scene, its
Hello.
I use a shader to write the depth value of a model as color in screen
using gl_FragColor = vec4(depth, depth, depth , 1).
But it seems it renders the model with only 8-bit per channel precision.
Can i change that behavior of the main camera (to 32-bit per channel)?
thnx.
Edit for the last question:
If i face such difficulties with only 1 character, how do the modern
3D action games work ?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
Hello.
I try to make my own camera manipulator in which the push events with
X lower than the half of the window will be ignored.
I created a class, which derives trackball manipulator.
Here is the handle method
virtual bool handle( const osgGA::GUIEventAdapter ea,
osgGA::GUIActionAdapter us )
Hello.
Not sure what you mean abandoned, but it works for me.
I have run some of the osgPPU examples.
thnx.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Hello.
I try to load a bmp image and set it to a texture.
When i render the model with the texture (using shaders), even though
the rgb channels are passed fine, the alpha channel is always 1.
When the image is loaded (using readImageFile), the pixel format is
GL_RGBA (which is correct).
But the
Hello.
I try to animate a model using RigTransformHardware.
The comments in createVertexAttribList() of RigTransformHardware.cpp say:
// create vertex attribute by 2 bones
// vec4(boneIndex0, weight0, boneIndex1, weight1)
// if more bones are needed then other attributes are created
//
Hello.
I try to implement shadowmapping for my scenes but i cant get shadow2D to work.
Here are the parts of code for shadowmapping using texture2D:
Vertex shader
shadow_coords = light_projection * light_view * vertex;
shadow_coords.xy = shadow_coords.xy / 2.0 + 0.5 *
Hello.
I have to load a .dae model in my scene and i was wondering if there is any
code example.
I use the following code
osg::ref_ptrosg::Node root = osgDB::readNodeFile( bmw.dae );
but i get a warning: Could not find plugin to read objects from file
bmw.dae.
I have built OpenSceneGraph code,
a copy of them in the prebuilt
3rd party dependencies that are distributed along side OSG. After that you
you should get a DAE plugin inside of the OSG projects list. This will
enable you to load collada files.
Regards,
Kim.
On 26 February 2012 15:47, Peterakos hay...@gmail.com wrote
Hello.
I found this shader line in the book:
float intensity = dot(vec3(gl_LightSource[0].position), normal );
i was wondering why he doesnt normalize the light source position.
He loads the cow.osg.
The normal vector is normalized using:
normal = normalize(gl_NormalMatrix * gl_Normal);
Thank
Hello.
Is there any way using the dae plugin in osg, to pass the vertices in
shader code as attributes?
What i do now for simple geometry shapes (lets assume we have a quad), is
to use
setAttributeValues( ... ); passing the vertices' positions, colors normals
etc.
How can i get this information
Hello.
Is there any Sample/Example for this ?
Thank you again.
On 26 March 2012 15:00, Christian Buchner christian.buch...@gmail.comwrote:
I'd say you would have to modify the DAE reader according to your
shader's needs, or alternatively you'd need to do some postprocessing
on the returned
Hello.
I have some problems reading colors from dae files.
I use a node visitor to traverse the scene graph.
On each geode's geometry, I get the vertices, normals and colors using:
geom-getVertexArray()
geom-getColorArray()
geom-getNormalArray()
The problem is that getColorArray() returns NULL.
Hello.
In the example osganimationviewer in main there is the following line:
osg::Group* node =
dynamic_castosg::Group*(osgDB::readNodeFiles(arguments));
How safe is this if i use only 1 model in arguments and it is not Group ?
Thank you for your time.
Hello.
I forgot to mention that i check it. That's why i posted it. Cause it is
very strange to run even though there is no group as root..
osg::ref_ptrosg::Group node =
dynamic_castosg::Group*(osgDB::readNodeFile( astroboy_walk.dae ));
if(!node) {
std::cout Model could not be loaded
Hello.
In my application i use the following code:
geom-setVertexAttribArray(0, data_array);
geom-setVertexAttribBinding(0, osg::Geometry::BIND_PER_VERTEX );
program-addBindAttribLocation(position_attr, 0);
I run this application in 2 different graphics cards:
1) NVidia 7900 GS
2) ATI 5570
Hello.
Is there any way to split the screen in 2 (vertical) ?
I would like to use 2 different cameras at the same time.
thnx.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
Hello.
I face a problem with a program attribute.
I enable the program using this:
osg::StateSet* stateset = model_node-getOrCreateStateSet();
stateset-setAttributeAndModes( program, osg::StateAttribute::ON |
osg::StateAttribute::OVERRIDE );
and i disable it using:
osg::StateSet* stateset =
Hello.
I have used this:
stateset-setAttributeAndModes(new osg::Program());
and it worked.
But why the other way didnt work ?
thnx.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
Hello.
This is what i did.
I disabled it in run time and checked the state set before and after this
line:
stateset-removeAttribute(osg::StateAttribute::PROGRAM)
Before that line the program was in attribute list along with lighting.
After that line, only lighting was there. But still the
Hello.
My task is to render an animated dae character with shaders.
I have created a simple vertex shader:
attribute vec4 position_attribute;
attribute vec4 color_attribute;
varying vec4 color;
void main(){
color = color_attribute;
gl_Position = gl_ModelViewProjectionMatrix *
Hello.
First of all the SceneGraph that is created after i read the dae file
doesnt have any RigTransformSoftware node.
Does that mean the values in the vertex array in the rig geometry will stay
the same during the program execution (and they will never get the updated
value) ?
In order for me
Hello.
I create a geom and i set the Vertex arrays and the Vertex Attrib arrays
for color, position and texcoords.
What i noticed is that even if i dont use shaders in my application, the
Vertex Attrib Arrays overwrite the Vertex Arrays.
Is that true ?
Nowhere in the application i set
Hello.
Are there sliders in osgWidget ?
Didnt find any example that uses sliders.
Do i have to create my own ?
thnx.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Hello.
I use CMake to create the openscenegraph solution
Even though i set the fltk paths paths, the osgviewerfltk project doesnt
appear in solution.
Here are the values i set in parameters:
FLTK_GL_LIBRARY:fltk 1-3-0/lib/fltkgl.lib
FLTK_INCLUDE_DIR: fltk 1-3-0/include
FLTK_LIBRARY:
Hello.
How do i change opengl profile between core and compatibility?
Which one is the default that the osg uses ?
thnx.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
Hello. I have 2 questions.
Does the osg::viewer's light continue to affect the sene graph if it (the
scenegraph) has each own lights?
How can i disable the viewer's operation of scaling down the models in a
scenegraph if they are too big?
thnx.
___
Hello.
I face a problem trying to compile open scene graph using open gl 3.
I get errors like these:
error C3861: 'glLoadMatrixf': identifier not found
error C3861: 'glMultMatrixf': identifier not found
error C3861: 'glLoadMatrixd': identifier not found
error C3861: 'glMultMatrixd': identifier
September 2012 04:58, Paul Martz pma...@skew-matrix.com wrote:
On 9/10/2012 10:34 AM, Peterakos wrote:
Hello.
I face a problem trying to compile open scene graph using open gl 3.
I get errors like these:
error C3861: 'glLoadMatrixf': identifier not found
error C3861: 'glMultMatrixf
Hello.
Has anyone managed to make AntTweakBar work with OpengGL 3.2 and the usage
of shaders in the models ?
Thnx.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Hello.
I did exactly what's written in comments in osgsimplegl3, except teh
CMAKE_CXX_FLAGS thing.
I created the solution, built it and worked fine except for 2 projects
which concern QT.
I managed to ran the osgsimplegl3.
The only thing i did with the gl3/gl3.h is to add this path in visual
Hello
These error i posted in my first post gave me a hard time. Even though I
tried everything to make them disappear they simple didnt.
I even tried to delete the whole OpenScenegraph/build directory and build
everything from scratch. But they were still there.
After that i deleted everything
Hello.
I create a class which inherits from drawble and i implement the
drawImplenetation method.
But as it seems it is called only once at start.
I want it to be called in every frame.
Do i have to create a DrawCallback and set it to Drawable ?
and what would the Drawable::drawImplementation
Hello.
The example osgsimplegl3 sets glcontext version to 3.1.
I load cow.osg and i get the following warnings :
warning: texgen::apply not supported
warning: material::apply not supported
When i set version to 3.2 the cow model is not rendered and i get the
previous warnings plus the
Hello.
I have managed to solve the problem with the 2 warnigs (by removing
materials and shades from cessna.osg.
Still cant solve the invalid enumerant. I use osgsimplegl3 as it is but
with more simple shaders and seting version to 3.2
Vertex
--
#version 150
uniform mat4
Hello.
I am trying to use an external widget library in osg.
This library tries to load the opengl functions during initialization using
wglGetProcAddress.
This procedure works in opengl but not in open scene graph. It fails for
functions in gl 1.2 and later.
I found this: The Microsoft Windows
Thank you very much.
it worked.
I added the init function of the widget toolkit in the callback.
thnx again.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
72 matches
Mail list logo