Preparation for moving osgGL2 out of the core OSG into its own seperate distribution.

This commit is contained in:
Robert Osfield 2005-04-14 11:28:23 +00:00
parent 22c695cdef
commit 16c55531da
17 changed files with 42 additions and 52 deletions

View File

@ -8,6 +8,8 @@ COMPILE_INTROSPECTION = no
# should we compile any of the examples?
COMPILE_EXAMPLES ?= no
# should we compile the deprecated osgGL2 library.
COMPILE_osgGL2 ?= no
# follows are dependenices on the various plugins.

View File

@ -20,9 +20,13 @@ SRC_DIRS = \
osgParticle\
osgText\
osgSim\
osgGL2\
osgFX\
osgProducer\
osgProducer
ifeq ($(COMPILE_osgGL2),yes)
SRC_DIRS += osgGL2
endif
SRC_DIRS += osgFX
ifeq ($(GDAL_INSTALLED),yes)
SRC_DIRS += osgTerrain
@ -42,6 +46,8 @@ WRAPPER_DIRS = \
osg\
################################################################
# Directories traversed in the TOPDIR/src/osgPlugins directory
@ -237,6 +243,9 @@ EXAMPLE_DIRS = \
osgvolume\
osgwindows\
ifeq ($(COMPILE_osgGL2),yes)
EXAMPLE_DIRS += osgGL2Shaders
endif
ifeq ($(COMPILE_INTROSPECTION),yes)
EXAMPLE_DIRS += osgintrospection

View File

@ -116,9 +116,6 @@ Package=<4>
Begin Project Dependency
Project_Dep_Name Core osgDB
End Project Dependency
Begin Project Dependency
Project_Dep_Name Core osgGL2
End Project Dependency
}}}
###############################################################################
@ -723,9 +720,6 @@ Package=<4>
Project_Dep_Name Core osgFX
End Project Dependency
Begin Project Dependency
Project_Dep_Name Core osgGL2
End Project Dependency
Begin Project Dependency
Project_Dep_Name Core osgGA
End Project Dependency
Begin Project Dependency
@ -953,9 +947,6 @@ Package=<4>
Begin Project Dependency
Project_Dep_Name Core osgFX
End Project Dependency
Begin Project Dependency
Project_Dep_Name Core osgGL2
End Project Dependency
}}}
###############################################################################
@ -1461,9 +1452,6 @@ Package=<4>
Project_Dep_Name Core osgGA
End Project Dependency
Begin Project Dependency
Project_Dep_Name Core osgGL2
End Project Dependency
Begin Project Dependency
Project_Dep_Name Core osgText
End Project Dependency
Begin Project Dependency
@ -1580,9 +1568,6 @@ Package=<4>
Begin Project Dependency
Project_Dep_Name Core osgFX
End Project Dependency
Begin Project Dependency
Project_Dep_Name Core osgGL2
End Project Dependency
}}}
###############################################################################
@ -1607,9 +1592,6 @@ Package=<4>
Begin Project Dependency
Project_Dep_Name Core osgFX
End Project Dependency
Begin Project Dependency
Project_Dep_Name Core osgGL2
End Project Dependency
}}}
###############################################################################
@ -2459,9 +2441,6 @@ Package=<4>
Begin Project Dependency
Project_Dep_Name Core osgFX
End Project Dependency
Begin Project Dependency
Project_Dep_Name Core osgGL2
End Project Dependency
}}}
###############################################################################

View File

@ -4,7 +4,7 @@ include $(TOPDIR)/Make/makedefs
CXXFILES =\
osgdem.cpp\
LIBS += -losgProducer -lProducer -losgTerrain -losgFX -losgGL2 -losgText -losgGA -losgDB -losgUtil -losg $(GDAL_LIBS) $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)
LIBS += -losgProducer -lProducer -losgTerrain -losgFX -losgText -losgGA -losgDB -losgUtil -losg $(GDAL_LIBS) $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)
INSTFILES = \
$(CXXFILES)\

View File

@ -5,7 +5,7 @@ CXXFILES =\
osgdem.cpp\
LIBS += -losgProducer -lProducer -losgTerrain -losgFX -losgGL2 -losgDB -losgText -losgUtil -losg $(GDAL_LIBS) $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)
LIBS += -losgProducer -lProducer -losgTerrain -losgFX -losgDB -losgText -losgUtil -losg $(GDAL_LIBS) $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)
EXEC = osgdem

View File

@ -5,7 +5,7 @@ CXXFILES =\
osgfxbrowser.cpp\
Frame.cpp\
LIBS += -losgProducer -lProducer -losgText -losgGA -losgDB -losgUtil -losg -losgGL2 -losgFX $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)
LIBS += -losgProducer -lProducer -losgText -losgGA -losgDB -losgUtil -losg -losgFX $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)
INSTFILES = \
$(CXXFILES)\

View File

@ -4,7 +4,7 @@ include $(TOPDIR)/Make/makedefs
CXXFILES =\
osgkeyboardmouse.cpp\
LIBS += -lProducer -losgFX -losgGL2 -losgDB -losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS) -lOpenThreads
LIBS += -lProducer -losgFX -losgDB -losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS) -lOpenThreads
INSTFILES = \
$(CXXFILES)\

View File

@ -4,7 +4,7 @@ include $(TOPDIR)/Make/makedefs
CXXFILES =\
osgkeyboardmouse.cpp\
LIBS += -lProducer -losgFX -losgGL2 -losgDB --losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)
LIBS += -lProducer -losgFX -losgDB --losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)
EXEC = osgkeyboardmouse

View File

@ -4,7 +4,7 @@ include $(TOPDIR)/Make/makedefs
CXXFILES =\
osgsimplepager.cpp\
LIBS += -lProducer -losgFX -losgGL2 -losgDB -losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS) -lOpenThreads
LIBS += -lProducer -losgFX -losgDB -losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS) -lOpenThreads
INSTFILES = \
$(CXXFILES)\

View File

@ -4,7 +4,7 @@ include $(TOPDIR)/Make/makedefs
CXXFILES =\
osgsimplepager.cpp\
LIBS += -lProducer -losgFX -losgGL2 -losgDB --losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)
LIBS += -lProducer -losgFX -losgDB --losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)
EXEC = osgsimplepager

View File

@ -4,7 +4,7 @@ include $(TOPDIR)/Make/makedefs
CXXFILES =\
osgsimulation.cpp\
LIBS += -losgTerrain -losgFX -losgGL2 -losgProducer -lProducer -losgParticle -losgSim -losgText -losgGA -losgDB -losgUtil -losg $(GDAL_LIBS) $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)
LIBS += -losgTerrain -losgFX -losgProducer -lProducer -losgParticle -losgSim -losgText -losgGA -losgDB -losgUtil -losg $(GDAL_LIBS) $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)
INSTFILES = \
$(CXXFILES)\

View File

@ -30,14 +30,14 @@ osgclip cow.osg
echo osgcubemap
osgcubemap cessna.osg
echo osgdepthshadow
osgdepthshadow
# echo osgdepthshadow
# osgdepthshadow
echo osgdistortion
osgdistortion cow.osg
echo osgforest
osgforest
#echo osgforest
#osgforest
echo osgfxbrowser
osgfxbrowser dumptruck.osg
@ -96,8 +96,8 @@ osgplanets
echo osgprerender
osgprerender dumptruck.osg
echo osgprerendercubemap
osgprerendercubemap
#echo osgprerendercubemap
#osgprerendercubemap
echo osgreflect
osgreflect cessna.osg

View File

@ -10,8 +10,9 @@
#include <osg/TexEnv>
#include <osg/LineWidth>
#include <osg/Material>
#include <osg/Program>
#include <osg/Shader>
#include <osgGL2/ProgramObject>
#include <sstream>
@ -44,7 +45,6 @@ namespace
// register a prototype for this effect
Registry::Proxy proxy(new Cartoon);
// default technique class
class DefaultTechnique: public Technique {
public:
@ -152,12 +152,11 @@ namespace
///////////////////////////////////////////////////////////////////////////
// A port of Marco Jez's "cartoon.cg" to the OpenGL Shading Language
// using osgGL2 by Mike Weiblen 2003-10-03.
// by Mike Weiblen 2003-10-03,
//
// This shader is simplified due to limitations in the OGLSL implementation
// in the current 3Dlabs driver. As the OGLSL implementation improves,
// need to revisit and enhance this shader.
namespace
{
class OGLSL_Technique : public Technique {
@ -178,7 +177,6 @@ namespace
{
// implement pass #1 (solid surfaces)
{
const char * vert_source =
"const vec3 LightPosition = vec3( 0.0, 2.0, 4.0 );"
"varying float CartoonTexCoord;"
@ -204,11 +202,13 @@ namespace
polyoffset->setUnits(1.0f);
ss->setAttributeAndModes(polyoffset.get(), osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON);
osg::ref_ptr<osgGL2::ProgramObject> progObj = new osgGL2::ProgramObject;
progObj->addShader( new osgGL2::ShaderObject( osgGL2::ShaderObject::VERTEX, vert_source ) );
progObj->addShader( new osgGL2::ShaderObject( osgGL2::ShaderObject::FRAGMENT, frag_source ) );
progObj->setSampler( "CartoonTexUnit", 0 );
ss->setAttributeAndModes( progObj.get(), osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON);
osg::ref_ptr<osg::Program> program = new osg::Program;
program->addShader( new osg::Shader( osg::Shader::VERTEX, vert_source ) );
program->addShader( new osg::Shader( osg::Shader::FRAGMENT, frag_source ) );
ss->addUniform( new osg::Uniform("CartoonTexUnit", 0));
ss->setAttributeAndModes( program.get(), osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON);
ss->setTextureMode(0, GL_TEXTURE_2D, osg::StateAttribute::OVERRIDE | osg::StateAttribute::OFF);

View File

@ -13,8 +13,8 @@ CXXFILES =\
Technique.cpp\
Validator.cpp\
LIBS += -losg -losgDB -losgUtil $(GL_LIBS) $(OTHER_LIBS) $(DYNAMICLIBRARYLIB)
LIBS += -losg -losgDB -losgUtil -losgGL2 $(GL_LIBS) $(OTHER_LIBS) $(DYNAMICLIBRARYLIB)
DEF += -DOSGFX_LIBRARY
TARGET_BASENAME = osgFX

View File

@ -80,7 +80,7 @@ CXXFILES =\
VertexProgram.cpp\
VisibilityGroup.cpp\
LIBS += -losgFX -losgGL2 -losgSim -losgText $(OSG_LIBS) $(OTHER_LIBS)
LIBS += -losgFX -losgSim -losgText $(OSG_LIBS) $(OTHER_LIBS)
TARGET_BASENAME = ive
include $(TOPDIR)/Make/cygwin_plugin_def

View File

@ -19,7 +19,7 @@ CXXFILES =\
INC += -I$(THISDIR)
LIBS += -losgFX -losgGL2 $(OSG_LIBS) $(OTHER_LIBS) $(GL_LIBS)
LIBS += -losgFX $(OSG_LIBS) $(OTHER_LIBS) $(GL_LIBS)
TARGET_BASENAME = lwo
include $(TOPDIR)/Make/cygwin_plugin_def

View File

@ -11,7 +11,7 @@ CXXFILES =\
IO_Effect.cpp\
LIBS += -losgFX -losgGL2 $(OSG_LIBS) $(OTHER_LIBS)
LIBS += -losgFX $(OSG_LIBS) $(OTHER_LIBS)
TARGET_BASENAME = osgFX
include $(TOPDIR)/Make/cygwin_plugin_def