Ignore:
Timestamp:
Jun 30, 2012, 7:44:12 PM (12 years ago)
Author:
Torben Dannhauer
Message:

ProjectSyntropy? Distortion works! It a alpha version, some bugs are still not hunted down.

Location:
experimental/distortionNG
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • experimental/distortionNG/DistortionManipulator.cpp

    r392 r393  
    517517void DistortionManipulator::updateDistortionSetup()
    518518{
    519         updateDistortionViewProjectionMatrix();
     519        //updateDistortionViewProjectionMatrix();
    520520        updateDistortionMesh();
    521521        _distortionSet->clearDirtyStatus();
     
    574574                osg::Vec2 tmpTexCoords = osg::Vec2(     tmpSrc.z()*_screenPixWidth,
    575575                                                                                        tmpSrc.w()*_screenPixHeight );
     576
    576577                texCoords->push_back(tmpTexCoords);
    577578                //OSG_ALWAYS<<"Transfering texcoord vertex : X:"<<tmpTexCoords.x()<<" Y:"<<tmpTexCoords.y()<<std::endl;
  • experimental/distortionNG/DistortionSetupStrategyProjectSyntropy.cpp

    r391 r393  
    412412                        }
    413413
    414 #if 0
     414#if 1
    415415                        for (osg::Vec4Array::iterator it = distortionMesh->begin(); it != distortionMesh->end(); ++it)
    416416                        {
     
    421421
    422422                        distortionSet->setDistortionMesh(distortionMesh);
    423                         distortionSet->setDistortionMeshColumns(distortionMeshColumns);
    424                         distortionSet->setDistortionMeshRows(distortionMeshRows);
     423                        //distortionSet->setDistortionMeshColumns(distortionMeshColumns);
     424                        //distortionSet->setDistortionMeshRows(distortionMeshRows);
     425                        distortionSet->setDistortionMeshDimensions(distortionMeshRows, distortionMeshColumns);
    425426                }
    426427        }
  • experimental/distortionNG/main.cpp

    r392 r393  
    9999                                                                                "./resources/ProjectSyntropy/blending_1.bmp",
    100100                                                                                "./resources/ProjectSyntropy/Vertices/frustum_1.csv",
    101                                                                                 DistortionSetupStrategy::VERTEXDISTORTION );
     101                                                                                DistortionSetupStrategy::TEXCOORDDISTORTION );
    102102        distortionManip->setDistortionSetupStrategy( psStrategy );
    103103        viewer.addEventHandler(distortionManip);
     
    129129    // load the nodes from the commandline arguments.
    130130    osg::Node* rootnode = osgDB::readNodeFiles(arguments);
     131        osgDB::Registry::instance()->getDataFilePathList().push_front("H:/AllInOnDB");
    131132
    132133    if (!rootnode)
    133134    {
    134                 //osgDB::Registry::instance()->getDataFilePathList().push_front("H:/AllInOnDB");
    135                 rootnode = osgDB::readNodeFile("resources/TestSphere/sphere_500.obj");
     135                rootnode = osgDB::readNodeFile("D:/osgVisual/experimental/distortionNG/resources/TestSphere/sphere_500.obj");
    136136                if(!rootnode)
    137137                {
  • experimental/distortionNG/shader.vert

    r392 r393  
    1 varying vec2 texcoord_scene;
    2 varying vec2 texcoord_intensityMap;
    3 
    41varying vec2 texCoord;
    52
     
    74{
    85        gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
    9         texcoord_scene = vec2(gl_MultiTexCoord0.xy);
    10         texcoord_intensityMap = vec2(gl_MultiTexCoord1.xy);
    116        texCoord = gl_MultiTexCoord0.xy;
    127}
  • experimental/distortionNG/shaderIntensityMap.frag

    r392 r393  
    11uniform sampler2DRect sceneTexture;
    22uniform sampler2DRect intensityMapTexture;
    3 varying vec2 texcoord_scene;
    4 varying vec2 texcoord_intensityMap;
    53
    64varying vec2 texCoord;
     
    86void main(void)
    97{
    10         vec4 sceneColor;
    11         vec4 blendColor;
    12 
    13         //sceneColor = texture2DRect(sceneTexture, gl_FragCoord);
    14         blendColor = texture2DRect(intensityMapTexture, gl_FragCoord);
     8        vec4 blendColor = texture2DRect(intensityMapTexture, gl_FragCoord);
    159       
    16         //gl_FragColor = blendColor * texture2DRect( sceneTexture, texCoord*vec2(1920, 1200)) ;
    17         gl_FragColor = texture2DRect( sceneTexture, texCoord*vec2(1920, 1200)) ;
     10        gl_FragColor = blendColor * texture2DRect( sceneTexture, texCoord) ;
    1811}
  • experimental/distortionNG/shaderIntensityMapVis.frag

    r363 r393  
    11uniform sampler2DRect sceneTexture;
    22uniform sampler2DRect intensityMapTexture;
    3 varying vec2 texcoord_scene;
    4 varying vec2 texcoord_intensityMap;
    53
    64void main(void)
Note: See TracChangeset for help on using the changeset viewer.