Re: [osg-users] [build] OpenThreads/Version and osg/Version

2014-11-29 Thread Christian Ruzicka
Hi,

Thanks Roberts! This makes the handling of our internal OSG repository easier.

Cheers,
Christian

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=61919#61919





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [build] OpenThreads/Version and osg/Version

2014-11-28 Thread Christian Ruzicka
Hi,

I have a question regarding OpenThreads/Version and osg/Version files: Instead 
of being generated by cmake into the ${PROJECT_BINARY_DIR} they are generated 
into the source directory (${CMAKE_CURRENT_SOURCE_DIR}). Doesn't this break out 
of source build? In addition those generated files are checked into the version 
control system.

Compare Config and GL header being generated into the build directory and the 
version file into the source directory (main CMakeList.txt file):

SET(OPENSCENEGRAPH_CONFIG_HEADER ${PROJECT_BINARY_DIR}/include/osg/Config)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/src/osg/Config.in
${OPENSCENEGRAPH_CONFIG_HEADER})
SET(OPENSCENEGRAPH_OPENGL_HEADER ${PROJECT_BINARY_DIR}/include/osg/GL)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/src/osg/GL.in
${OPENSCENEGRAPH_OPENGL_HEADER})
# INSTALL_FILES(/include/osg/ FILES ${OPENSCENEGRAPH_CONFIG_HEADER})

# Set Vertsion header file
SET(OPENSCENEGRAPH_VERSION_HEADER 
${CMAKE_CURRENT_SOURCE_DIR}/include/osg/Version)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/src/osg/Version.in
${OPENSCENEGRAPH_VERSION_HEADER})

Is there a special reason or was it done by mistake?

Thank you!

Cheers,
Christian

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=61908#61908





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG and OpenGL ES 2.0

2011-04-06 Thread Christian Ruzicka
Hi,

it's just a really simple scene but it should help you figuring out, if your 
OpenGLES 2.0 support works (tested on iPhone):


Code:
// create geometry
osg::Group* scene = new osg::Group;
osg::Geode* geode = new osg::Geode;
osg::Geometry* geo = new osg::Geometry;
scene-addChild(geode);
geode-addDrawable(geo);

// set vertices
osg::Vec3Array* vertices = new osg::Vec3Array;
vertices-push_back(osg::Vec3(0.0, 0.0, 0.0));
vertices-push_back(osg::Vec3(0.0, 0.0, 1.0));
vertices-push_back(osg::Vec3(1.0, 0.0, 0.0));
vertices-push_back(osg::Vec3(1.0, 0.0, 1.0));
geo-setVertexArray(vertices);

// set colors
osg::Vec4Array* colors = new osg::Vec4Array;
colors-push_back(osg::Vec4(1.0, 0.0, 0.0, 1.0));
colors-push_back(osg::Vec4(0.0, 1.0, 0.0, 1.0));
colors-push_back(osg::Vec4(0.0, 0.0, 1.0, 1.0));
colors-push_back(osg::Vec4(1.0, 0.0, 1.0, 1.0));
geo-setVertexAttribArray(7, colors);
geo-setVertexAttribBinding(7, osg::Geometry::BIND_PER_VERTEX);

// set primitive set
geo-addPrimitiveSet(new osg::DrawArrays(GL_TRIANGLE_STRIP, 0, 4));
geo-setUseVertexBufferObjects(true);

// declare shaders
char vertSource[] =
attribute vec4 osg_Vertex;\n
attribute vec4 a_col;
uniform mat4 osg_ModelViewProjectionMatrix;\n
varying vec4 v_col;

void main(void)\n
{\n
gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex;\n
v_col = a_col;\n
}\n;

char fragSource[] =
precision mediump float;\n
varying vec4 v_col;

void main(void)\n
{\n
gl_FragColor = v_col;\n
}\n;

// set shader
osg::Program* program = new osg::Program;
program-setName( simple shader );
program-addShader( new osg::Shader( osg::Shader::VERTEX, vertSource ) );
program-addShader( new osg::Shader( osg::Shader::FRAGMENT, fragSource ) );
program-addBindAttribLocation(a_col, 7);
geode-getOrCreateStateSet()-setAttributeAndModes( program, 
osg::StateAttribute::ON );

// set scene in viewer...




HTH,
Christian

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=38263#38263





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG and OpenGL ES 2.0

2011-04-06 Thread Christian Ruzicka
Hi,

just one addition to my previous post: Normally you wouldn't define an extra 
vertex attribute array for the vertex color/normal as I did in this test code. 
Just use 

void Geometry::setColorArray(Array* array);
void Geometry::setNormalArray(Array* array);

and access the vertex color/normal in the vertex shader via osg_Color and 
osg_Normal (OSG will do the mapping for you).

Cheers,
Christian

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=38270#38270





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSGs OpenGLES 2.0 status

2010-10-29 Thread Christian Ruzicka
Hi,

In the meantime I got a better understanding of OSG regarding OpenGLES 2.0 
support and osgText, osgTerrain and osgEarth are now basically running in the 
OpenGLES 2.0 Emulator (globeview with some labels and streets).

I also saw the thread regarding the ShaderComposer, its design and the feature 
set:

Shader composition, OpenGL modes and custom modes (I'm not allowed to post 
links yet)

The last post in this thread was in July. Are there any news regarding the 
implementation?

Thank you!

Cheers,
Christian

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=33251#33251





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] OSGs OpenGLES 2.0 status

2010-10-26 Thread Christian Ruzicka
Hi,

I’m currently evaluating OSGs OpenGLES 2.0 capabilities on Windows with 
PVRVFrame (OpenGLES 2.0 Emulator). “OSG core” compiles and runs fine (simple 
textured model and an osgText node). So the next step is to test the other 
nodekits/plugins/advanced features. Can someone please give me a short overview 
of the current OpenGLES 2.0 status and answer the following questions?

- Which nodekits/plugins run without modifications on OpenGLES 2.0? 

- What if a nodekit/plugin composes a subgraph which is not compatible with 
OpenGLES 2.0 (e.g. uses FFP or the shader source cannot be converted)? Do I 
have to manually attach an OpenGLES 2.0 compatible shader program to every 
node/subgraph? Will the ShaderComposer automatically insert shader programs to 
the nodes/subgraphs to emulate the FFP in the future?

- I’m having problems with the HW mipmap generation. I get only black textures 
when activating the HW support. Mipmaps generated by SW are working fine. Does 
HW mipmap generation work on the IPhone with OSG?

- Does the IPhone git branch have more adaptions regarding OpenGLES 2.0 or is 
the main branch up to date?

I’m new to OSG so please correct me, if I got something wrong! :-)

Thanks,
Christian

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=33082#33082





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org