Re: [osg-users] Support for COLLADA_DOM 2.4 checked in

2016-01-04 Thread Alex Cham

robertosfield wrote:
> 
> Let me know how you get on,
> 


Hi Robert. Ah ok, - my fault. Mostly it was some kind of a technical report 
about successful build of osg+dae plugin. With focal points for those who 
already know how to. Should try to do my best next time :O

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





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


Re: [osg-users] Support for COLLADA_DOM 2.4 checked in

2015-12-13 Thread Alex Cham
Hi, Robert!

# TESTED AGAINST

# commit 9a6b96ea61859aa21c60a86fa3fa5eb07d93346b
# Author: Robert OSFIELD
# Date:   Mon Nov 9 16:02:09 2015 +
# Updated ChangeLog for 3.5.1 dev release
# git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15181 
16af8721-9629-0410-8352-f15c8da7e697

# AND

# commit 94433cd7445db88420cd239e6a3d87bcbd2883cc
# Author: rosen
# Date:   Wed Oct 14 20:16:46 2015 +0900
# fix new lines to conform to unix (from debian 
http://anonscm.debian.org/cgit/debian-science/packages/collada-dom.git/diff/debian/patches/linefeed-fixup.patch?id=9652330772f7e441b423a41d88f\
#  52c245569c049)




Prerequisites


DAE::open BUG DOM 1.4.1
https://bugzilla.redhat.com/show_bug.cgi?id=1082260
DAE::open BUG DOM 1.4.1 (FIXED since 2.4.3)
https://github.com/rdiankov/collada-dom/blob/master/changelog.rst#243



forked core collada-dom library into github
fork does not contain any viewers/opengl/windowing library dependencies

https://forums.khronos.org/showthread.php/11302-collada-dom-forked-to-github
https://github.com/rdiankov/collada-dom



COLLADA DOM 2.4.0 DOM 1.4.1, 1.5.0

https://github.com/rdiankov/collada-dom/blob/master/changelog.rst#240



COLLADA DOM 2.4.0 DOM 1.4.1 since OSG 2014/11/23
http://forum.openscenegraph.org/viewtopic.php?t=14539&highlight=collada

Plugin depends from Collada DOM library
plugin only work with DOM 1.4 of Collada DOM
Collada DOM library depends from Boost (part), libxml2, pcre, pcrecpp, minizip, 
zlib

(Page require content UPDATE!)
http://www.openscenegraph.org/index.php/documentation/guides/user-guides/111-collada



-DCOLLADA_INCLUDE_DIR= && -DCOLLADA_DYNAMIC_LIBRARY=

osgviewer myFile.dae
osgconv myFile.osg myFile.dae

https://github.com/openscenegraph/osg/blob/master/src/osgPlugins/dae/README.txt



collada-dom/dom/test/1.4/data/

cube.dae
Seymour.dae
https://github.com/rdiankov/collada-dom/tree/master/dom/test/1.4/data







Code:


# ERROR

# Error occurs if 1.5 dom linked into OSG but reading 1.4.dae and vice versa

# Error: Trying to load an invalid COLLADA version for this DOM build!
# Error: Failed to load 
file:/home/opengl/Research/GLES2/Assets/Animation/test.asf.amc.dae

# Load failed in COLLADA DOM
# Load failed in COLLADA DOM conversion

# FIXES

# COLLADA DOM CMake Defaults

# #option(OPT_COLLADA15 "Enable collada 1.5 compilation" ON)
# #option(OPT_COLLADA14 "Enable collada 1.4 compilation" ON)

# MUST for OSG + COLLADA DOM (Build vCOLLADA DOM 1.4 library only)!

# cd ./x64Linux && \
# /usr/bin/cmake \
#   ../src \
#   -DOPT_COLLADA15=0 \
#   -DOPT_COLLADA14=1



#export PATH = ${PATH}:/home/myaccount/OpenSceneGraph/bin
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:../x64LinuxMesaGL2/lib/;
export OSG_FILE_PATH=../Assets/:../Assets/Images;

#../x64LinuxMesaGL2/bin/osgconv --format dae
# Same as above
../x64LinuxMesaGL2/bin/osgconv --plugin 
../x64LinuxMesaGL2/lib/osgPlugins-3.5.1/osgdb_dae.so


# COLLADA DOM Default cube.dae
# https://github.com/rdiankov/collada-dom/tree/master/dom/test/1.4/data

#../x64LinuxMesaGL2/bin/osganimationviewer 
/home/opengl/Research/GLES2/Repo/colladadom/src/dom/test/1.4/data/cube.dae
# PASSED

../x64LinuxMesaGL2/bin/osganimationviewer 
/home/opengl/Research/GLES2/Repo/colladadom/src/dom/test/1.4/data/Seymour.dae
# PASSED


#../x64LinuxMesaGL2/bin/osganimationviewer 
/home/opengl/Research/GLES2/Repo/colladadom/src/dom/test/1.5/data/Seymour.dae
# FAILED
# With the above error






Thank you!

Cheers,
Alex

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





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


Re: [osg-users] [GL ES2] Compilation errors on master branch

2015-09-06 Thread Alex Cham

robertosfield wrote:
> Hi Alex,
> Could you please checked out OSG svn/trunk and let me know how you get on.
> 


Hi Robert! Sorry for this long pause in response. Ok i should check and report 
as soon as possible.

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





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


Re: [osg-users] [build] Linux x84-64 + LLVMToolchain + OpenSceneGraph 3.3.8.122 + OpenGL Core Profile (Build Errors & Fixes)

2015-07-28 Thread Alex Cham
Hi,

Nothing to say here, just Look the attachment in tex/latex editor to see the 
tree structure.

$ git log -1

commit 57b5747ef44ff8d5a21ca1a5420aa309a7273492
Date:   Thu Jun 4 09:35:19 2015 +

Thank you!

Cheers,
Alex

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




Attachments: 
http://forum.openscenegraph.org//files/glcorecontextbuildreadme_179.txt


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


Re: [osg-users] [build] Linux x84-64 + GCCToolchain + OpenSceneGraph 3.3.8.122 + OpenGL Core Profile (Build Errors & Fixes)

2015-07-28 Thread Alex Cham
Hi! & first of all thank you Robert & all the community for this awesome 
software!

And the second is the attachment with incompatibilities & fixes against GL 4.3 
Core Defined Header Conventions which i have found in my attempts to become 
intermediate OSG developer.  Don't be very strict if i mistaken, because i am 
new to C/C++, CMake, OSG.

SET(OPENSCENEGRAPH_MAJOR_VERSION 3)
SET(OPENSCENEGRAPH_MINOR_VERSION 3)
SET(OPENSCENEGRAPH_PATCH_VERSION 8)
SET(OPENSCENEGRAPH_SOVERSION 122)

$ git log -1

commit 57b5747ef44ff8d5a21ca1a5420aa309a7273492
Date:   Thu Jun 4 09:35:19 2015 +

Hope it helps somehow. My best regards!

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




Attachments: 
http://forum.openscenegraph.org//files/gl43headersconventionbuildreadmev2_174.txt


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


Re: [osg-users] [GL ES2] Compilation errors on master branch

2015-07-22 Thread Alex Cham
Hi! Here is what i have found & fix while build OSG with GLES2 subset. See in 
attachment

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




Attachments: 
http://forum.openscenegraph.org//files/gles2contextbuildreadme_156.txt


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


Re: [osg-users] [GL ES2] Compilation errors on master branch

2015-07-22 Thread Alex Cham
Hi, Here is what i have found & how it was fixed

OpenSceneGraph Version


#define OPENSCENEGRAPH_MAJOR_VERSION3
#define OPENSCENEGRAPH_MINOR_VERSION5
#define OPENSCENEGRAPH_PATCH_VERSION0
#define OPENSCENEGRAPH_SOVERSION130


$ git log -1
commit bc3a77cb1561ed2e47e88ab507180bcf15309f31
Author: Robert OSFIELD <>
Date:   Fri Jul 17 18:31:22 2015 +










Configure & Compile OSG For GLESX



http://trac.openscenegraph.org/projects/osg/wiki/Community/OpenGL-ES

$ ls -ail /usr/lib/x86_64-linux-gnu | grep EG
 671904 lrwxrwxrwx   1 root root   15 Jul 10 13:08 libEGL.so -> 
libEGL.so.1.0.0
 671897 lrwxrwxrwx   1 root root   15 Jul 10 13:08 libEGL.so.1 -> 
libEGL.so.1.0.0
 656425 -rw-r--r--   1 root root   173208 Jul 10 13:08 libEGL.so.1.0.0

$ ls -ail /usr/lib/x86_64-linux-gnu | grep ES
 660380 lrwxrwxrwx   1 root root   21 Jul 10 13:08 libGLESv1_CM.so.1 -> 
libGLESv1_CM.so.1.1.0
 660378 -rw-r--r--   1 root root18232 Jul 10 13:08 libGLESv1_CM.so.1.1.0
 656932 lrwxrwxrwx   1 root root   18 Jul 10 13:08 libGLESv2.so -> 
libGLESv2.so.2.0.0
 671907 lrwxrwxrwx   1 root root   18 Jul 10 13:08 libGLESv2.so.2 -> 
libGLESv2.so.2.0.0
 668652 -rw-r--r--   1 root root26424 Jul 10 13:08 libGLESv2.so.2.0.0


$ ls -ail /usr/include/ | grep ES
1573223 drwxr-xr-x  2 root root   4096 Jul 18 20:16 GLES2
1573218 drwxr-xr-x  2 root root   4096 Jul 18 20:16 GLES3


mkdir ./GLES2ContextBuild
cd ./GLES2ContextBuild

cmake \
-DCMAKE_C_COMPILER="/usr/bin/clang" \
-DCMAKE_CXX_COMPILER="/usr/bin/clang++" \
-DCMAKE_CXX_FLAGS="-std=c++11 -v -Wall" \
-DBUILD_OSG_EXAMPLES=1 \
-DOSG_GL1_AVAILABLE=OFF \
-DOSG_GL2_AVAILABLE=OFF \
-DOSG_GL3_AVAILABLE=OFF \
-DOSG_GLES1_AVAILABLE=OFF \
-DOSG_GLES2_AVAILABLE=ON \
-DOPENGL_INCLUDE_DIR=/usr/include/ \
-DOPENGL_LIBRARY=/usr/lib/x86_64-linux-gnu/libGLESv2.so \
-DOPENGL_egl_LIBRARY=/usr/lib/x86_64-linux-gnu/libEGL.so \
-DOSG_GL_DISPLAYLISTS_AVAILABLE=OFF \
-DSG_GL_MATRICES_AVAILABLE=OFF \
-DOSG_GL_VERTEX_FUNCS_AVAILABLE=OFF \
-DOSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE=OFF \
-DOSG_GL_FIXED_FUNCTION_AVAILABLE=OFF \
-DOSG_CPP_EXCEPTIONS_AVAILABLE=OFF \
../GLES2ContextSource









LLVMToolchain Errors & Fixes

typedef redefinition with different types (typedef long long int
GLint64)


E:
/home/alex/dev/sources/osgbullet/Dependencies/osg/LLVM/GLES2ContextBuild/include/osg/GL:123:31:
 error: typedef redefinition with different types
  ('long long' vs 'khronos_int64_t' (aka 'long'))
typedef long long int GLint64;
  ^
/usr/include/GLES2/gl2.h:63:25: note: previous definition is here
typedef khronos_int64_t GLint64;


F:

osg/src/osg/GL.in

Just comment or remove the else block and all compiles perfect. GLint64 is
already defined in headers provided by Mesa3d for your platform as "typedef
khronos_int64_t GLint64;" For Windows maybe, have nothing to say here because i
dont use it, but for Linux why should we redefine something here explicitly?

#if !defined(GL_VERSION_3_1)
#ifdef _WIN32
typedef  __int64 GLint64;
typedef unsigned __int64 GLuint64;
#else
/*typedef long long int GLint64;*/
/*typedef unsigned long long int GLuint64;*/
#endif
#endif






undeclared identifier 'GL_ALPHA_TEST'

E:
/home/alex/dev/sources/osgbullet/Dependencies/osg/LLVM/GLES2ContextSource/examples/osgSSBO/osgSSBO.cpp:550:48:
 error: use of undeclared identifier
  'GL_ALPHA_TEST'
_computationResultsRenderStateSet->setMode(GL_ALPHA_TEST, 
osg::StateAttribute::ON);


F:

GL_ALPHA_TEST Is not declared in GLES2

https://www.khronos.org/opengles/sdk/docs/man/xhtml/glEnable.xml

http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk/examples/osgSSBO/CMakeLists.txt

IF ((OPENGL_PROFILE STREQUAL "GL3") OR (OPENGL_PROFILE STREQUAL "GLCORE"))
# E: 2
#/home/alex/dev/sources/osgbullet/Dependencies/osg/GL43HeadersConventionSource/examples/osgSSBO/osgSSBO.cpp:550:48:
 error: ‘GL_ALPHA_TEST’ was not declared in this scope
# _computationResultsRenderStateSet->setMode(GL_ALPHA_TEST, 
osg::StateAttribute::ON);

# F:

# GL 2
#GL_ALPHA_TEST
#
#If enabled,do alpha testing. See glAlphaFunc.
#   
#https://www.opengl.org/sdk/docs/man2/xhtml/glEnable.xml

# GL 3
#No Enumerant GL_ALPHA_TEST
#https://www.opengl.org/sdk/docs/man3/xhtml/glEnable.xml

ELSEIF(OSG_GLES2_AVAILABLE STREQUAL "ON")

#E:
#/home/alex/dev/sources/osgbullet/Dependencies/osg/LLVM/GLES2ContextSource/examples/osgSSBO/osgSSBO.cpp:550:48:
 error: use of undeclared identifier
#  'GL_ALPHA_TEST'
#_computationResultsRenderStateSet->setMode(GL_ALPHA_TEST, 
osg::StateAttribute::ON);
#
#
#F:
#
#http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk/examples/osgSSBO/CMakeLists.txt
#
#GL_ALPHA_TEST Is not declared in GLES2
#
#https://www.khronos.org/opengles/sdk/docs/man/xhtml/glEnable.xml

ELSE()

SET(TARGET_SRC osgSSBO.cpp )
SETUP_EXAMPLE(osgSSBO)

ENDIF()





call to 'isinf' is ambiguous


E:
/home/alex/dev/sources/osgbullet/Dependencies/os

Re: [osg-users] OSG 3.5.0 (130) GLES2 Shaders Example

2015-07-20 Thread Alex Cham
Just OSG 3.5.0 (130) GLES2 Shaders Example V2

/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2015 Alex Cham
 *
 * This example is open source and may be redistributed and/or modified under
 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
 * (at your option) any later version.  The full license is in LICENSE file
 * included with this distribution, and on the openscenegraph.org website.
 *
 * This example is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * OpenSceneGraph Public License for more details.

#define OPENSCENEGRAPH_MAJOR_VERSION3
#define OPENSCENEGRAPH_MINOR_VERSION5
#define OPENSCENEGRAPH_PATCH_VERSION0
#define OPENSCENEGRAPH_SOVERSION130

$ git log -1
commit bc3a77cb1561ed2e47e88ab507180bcf15309f31
Author: Robert OSFIELD 
Date:   Fri Jul 17 18:31:22 2015 +
*/
#include 

#include 
#include 
#include 

#include 
#include 
#include 

using namespace osg;


static const char *vertexShaderSource = {
"#version 100\n"
//  "uniform mat4 mvp_matrix;// model-view-projection matrix\n"
"uniform mat3 normal_matrix;// normal matrix\n"
"uniform vec3 ec_light_dir;// light direction in eye coords\n"
"attribute vec4 a_vertex;// vertex position\n"
"attribute vec3 a_normal;// vertex normal\n"
//  "attribute vec2 a_texcoord;// texture coordinates\n"
//  "varying float v_diffuse;\n"
//  "varying vec2 v_texcoord;\n"
"void main(void)\n"
"{\n"
"// put vertex normal into eye coords\n"
"vec3 ec_normal = normalize(normal_matrix * a_normal);\n"
//  "// emit diffuse scale factor, texcoord, and position\n"
//  "v_diffuse = max(dot(ec_light_dir, ec_normal), 0.0);\n"
//  "v_texcoord= a_texcoord;\n"
"gl_Position = gl_ModelViewProjectionMatrix * a_vertex;\n"
"}\n"};

static const char *fragmentShaderSource = {
"#version 100\n"
"precision mediump float;\n"
"void main()\n"
"{\n"
"gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n"
"}\n"};


int main(int, char **)
{
osg::setNotifyLevel(osg::INFO);


// construct the viewer.
osgViewer::Viewer viewer;

// use a geode with a Box ShapeDrawable
osg::Geode* geode = new osg::Geode();
geode->addDrawable(new osg::ShapeDrawable(new 
osg::Box(osg::Vec3(0.0f,0.0f,0.0f),1.0f)));

osg::StateSet *ss = geode->getOrCreateStateSet();
osg::Program* program = new osg::Program;

program->addShader( new osg::Shader( osg::Shader::VERTEX, 
vertexShaderSource ) );
program->addShader( new osg::Shader( osg::Shader::FRAGMENT, 
fragmentShaderSource ) );
ss->setAttributeAndModes(program, osg::StateAttribute::ON);

viewer.setSceneData(geode);
return viewer.run();
}
/*

mkdir ./GLES2ContextBuild
cd ./GLES2ContextBuild

cmake \
-DCMAKE_C_COMPILER="/usr/bin/clang" \
-DCMAKE_CXX_COMPILER="/usr/bin/clang++" \
-DCMAKE_CXX_FLAGS="-std=c++11 -v -Wall" \
-DBUILD_OSG_EXAMPLES=1 \
-DOSG_GL1_AVAILABLE=OFF \
-DOSG_GL2_AVAILABLE=OFF \
-DOSG_GL3_AVAILABLE=OFF \
-DOSG_GLES1_AVAILABLE=OFF \
-DOSG_GLES2_AVAILABLE=ON \
-DOPENGL_INCLUDE_DIR=/usr/include/ \
-DOPENGL_LIBRARY=/usr/lib/x86_64-linux-gnu/libGLESv2.so \
-DOPENGL_egl_LIBRARY=/usr/lib/x86_64-linux-gnu/libEGL.so \
-DOSG_GL_DISPLAYLISTS_AVAILABLE=OFF \
-DSG_GL_MATRICES_AVAILABLE=OFF \
-DOSG_GL_VERTEX_FUNCS_AVAILABLE=OFF \
-DOSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE=OFF \
-DOSG_GL_FIXED_FUNCTION_AVAILABLE=OFF \
-DOSG_CPP_EXCEPTIONS_AVAILABLE=OFF \
../GLES2ContextSource

http://trac.openscenegraph.org/projects/osg/wiki/Community/OpenGL-ES



Based on OSG osgsimpleshaders.cpp
http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk/examples/osgsimpleshaders/osgsimpleshaders.cpp

See Also Hello Triangle: An OpenGL ES 2.0 Example
https://www.khronos.org/assets/uploads/books/openglr_es_20_programming_guide_sample.pdf

OpenGL ES 2.0 API & OpenGL ES Shading Language 1.0 Quick Reference Card
https://www.khronos.org/files/opengles20-reference-card.pdf

OpenGL ES Shading Language Version 1.00
https://www.khronos.org/files/opengles_shading_language.pdf
 */


Thank you!

Cheers,
Alex

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





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


[osg-users] OSG 3.5.0 (130) GLES2 Shaders Example

2015-07-20 Thread Alex Cham
Hi,

Just Simple OSG 3.5.0 (130) GLES2 Shaders Example


Code:
/**

#define OPENSCENEGRAPH_MAJOR_VERSION3
#define OPENSCENEGRAPH_MINOR_VERSION5
#define OPENSCENEGRAPH_PATCH_VERSION0
#define OPENSCENEGRAPH_SOVERSION130

$ git log -1
commit bc3a77cb1561ed2e47e88ab507180bcf15309f31
Author: Robert OSFIELD <>
Date:   Fri Jul 17 18:31:22 2015 +



mkdir ./GLES2ContextBuild
cd ./GLES2ContextBuild

cmake \
-DCMAKE_C_COMPILER="/usr/bin/clang" \
-DCMAKE_CXX_COMPILER="/usr/bin/clang++" \
-DCMAKE_CXX_FLAGS="-std=c++11 -v -Wall" \
-DBUILD_OSG_EXAMPLES=1 \
-DOSG_GL1_AVAILABLE=OFF \
-DOSG_GL2_AVAILABLE=OFF \
-DOSG_GL3_AVAILABLE=OFF \
-DOSG_GLES1_AVAILABLE=OFF \
-DOSG_GLES2_AVAILABLE=ON \
-DOPENGL_INCLUDE_DIR=/usr/include/ \
-DOPENGL_LIBRARY=/usr/lib/x86_64-linux-gnu/libGLESv2.so \
-DOPENGL_egl_LIBRARY=/usr/lib/x86_64-linux-gnu/libEGL.so \
-DOSG_GL_DISPLAYLISTS_AVAILABLE=OFF \
-DSG_GL_MATRICES_AVAILABLE=OFF \
-DOSG_GL_VERTEX_FUNCS_AVAILABLE=OFF \
-DOSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE=OFF \
-DOSG_GL_FIXED_FUNCTION_AVAILABLE=OFF \
-DOSG_CPP_EXCEPTIONS_AVAILABLE=OFF \
../GLES2ContextSource

http://trac.openscenegraph.org/projects/osg/wiki/Community/OpenGL-ES



Based on OSG osgsimpleshaders.cpp
http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk/examples/osgsimpleshaders/osgsimpleshaders.cpp

See Also Hello Triangle: An OpenGL ES 2.0 Example
https://www.khronos.org/assets/uploads/books/openglr_es_20_programming_guide_sample.pdf


 */
#include 

#include 
#include 
#include 

#include 
#include 
#include 

using namespace osg;


static const char *vertexShaderSource = {
"attribute vec4 vPosition;\n"
"void main()\n"
"{\n"
"gl_Position = vPosition;\n"
"}\n"};

static const char *fragmentShaderSource = {
"precision mediump float;\n"
"void main()\n"
"{\n"
"gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n"
"}\n"};


int main(int, char **)
{
osg::setNotifyLevel(osg::INFO);


// construct the viewer.
osgViewer::Viewer viewer;

// use a geode with a Box ShapeDrawable
osg::Geode* geode = new osg::Geode();
geode->addDrawable(new osg::ShapeDrawable(new 
osg::Box(osg::Vec3(0.0f,0.0f,0.0f),1.0f)));

osg::StateSet *ss = geode->getOrCreateStateSet();
osg::Program* program = new osg::Program;

program->addShader( new osg::Shader( osg::Shader::VERTEX, 
vertexShaderSource ) );
program->addShader( new osg::Shader( osg::Shader::FRAGMENT, 
fragmentShaderSource ) );
ss->setAttributeAndModes(program, osg::StateAttribute::ON);

viewer.setSceneData(geode);
return viewer.run();
}

/*EOF*/




Thank you!

Cheers,
Alex[/code]

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





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