- Timestamp:
- Nov 7, 2010, 8:02:38 PM (14 years ago)
- Location:
- osgVisual
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
osgVisual/bin/osgVisualConfig.xml
r147 r148 12 12 window : renderImplementation = osg::Camera::SEPERATE_WINDOW 13 13 --> 14 <distortion channelname="center" renderimplemmentation="fbo" hdr="yes">15 <!-- optional: <distortionmap filename="distmap.png"></distortionmap> -->16 <!-- optional: <blendmap filename="blendmap.png"></blendmap> -->17 </distortion>14 <distortion channelname="center" renderimplemmentation="fbo" width="2048" height="2048" useshader="yes" hdr="yes" usetexturerectangle="no"> 15 <!-- optional: <distortionmap filename="distmap.png"></distortionmap> to set distortionmap independend from channel map--> 16 <!-- optional: <blendmap filename="blendmap.png"></blendmap> to set blendmap independend from channel map --> 17 </distortion> 18 18 </module> 19 19 <module name="sky_silverlining" enabled="yes"></module> -
osgVisual/include/distortion/visual_distortion.h
r145 r148 33 33 #include <osgGA/GUIActionAdapter> 34 34 35 #include <visual_util.h> 36 35 37 #include <string> 36 38 #include <iostream> 37 39 #include <fstream> 40 41 // XML Parser 42 #include <stdio.h> 43 #include <libxml/parser.h> 44 #include <libxml/tree.h> 38 45 39 46 … … 68 75 virtual ~visual_distortion(void); 69 76 77 bool processXMLConfiguration(); 78 70 79 /** 71 80 * \brief This function parses the arguments for distortion relevant parameters. … … 469 478 470 479 /** 480 * XML config filename 481 */ 482 std::string configFileName; 483 484 /** 471 485 * Target implementation which should be used to distort. 472 486 */ -
osgVisual/src/core/visual_core.cpp
r144 r148 363 363 // Pass the nodes to the corresponding modules... 364 364 if(name == "core") this->config(a_node); 365 366 365 } 367 366 -
osgVisual/src/distortion/visual_distortion.cpp
r147 r148 23 23 OSG_NOTIFY (osg::ALWAYS ) << "visual_distortion instantiated." << std::endl; 24 24 25 this->configFileName = configFileName; 25 26 initialized = false; 26 27 distortionEnabled = false; … … 37 38 { 38 39 OSG_NOTIFY (osg::ALWAYS ) << "visual_distortion destroyed." << std::endl; 40 } 41 42 bool visual_distortion::processXMLConfiguration() 43 { 44 // Init XML 45 xmlDoc* tmpDoc; 46 xmlNode* config = util::getModuleXMLConfig( configFileName, "distortion", tmpDoc ); 47 if(config) 48 { 49 xmlNode* a_node = config; 50 // Extract infos 51 std::string name = ""; 52 bool enabled = false; 53 54 xmlAttr *attr = a_node->properties; 55 while ( attr ) 56 { 57 std::string attr_name=reinterpret_cast<const char*>(attr->name); 58 std::string attr_value=reinterpret_cast<const char*>(attr->children->content); 59 if( attr_name == "name" ) 60 name = reinterpret_cast<const char*>(attr->children->content); 61 if( attr_name == "enabled" && attr_value== "yes" ) 62 enabled = true; 63 if( attr_name == "enabled" && attr_value== "no" ) 64 enabled = false; 65 66 attr = attr->next; 67 } 68 OSG_ALWAYS << "Module '" << name << "' found. Enabled = " << enabled << std::endl; 69 } 70 71 // extract configuration values 72 73 // clean up 74 if(tmpDoc) 75 { 76 xmlFreeDoc(tmpDoc); xmlCleanupParser(); 77 return true; 78 } 79 80 return true; 39 81 } 40 82 … … 64 106 65 107 // Read out Distortion CMDLine arguments 66 while (arguments.read("--width", tex_width)) {}67 while (arguments.read("--height", tex_height)) {}68 69 while (arguments.read("--fbo")) { renderImplementation = osg::Camera::FRAME_BUFFER_OBJECT; }70 71 72 73 74 75 while (arguments.read("--texture-rectangle")) { useTextureRectangle = true; }76 77 while (arguments.read("--shaderDistortion")) { useShaderDistortion = true; }78 79 while (arguments.read("--hdr")) { useHDR = true; }80 81 while (arguments.read("--distortionmap", distortMapFileName)) { }82 while (arguments.read("--blendmap", blendMapFileName)) { }108 //while (arguments.read("--width", tex_width)) {} 109 //while (arguments.read("--height", tex_height)) {} 110 111 //while (arguments.read("--fbo")) { renderImplementation = osg::Camera::FRAME_BUFFER_OBJECT; } 112 //while (arguments.read("--pbuffer")) { renderImplementation = osg::Camera::PIXEL_BUFFER; } 113 //while (arguments.read("--pbuffer-rtt")) { renderImplementation = osg::Camera::PIXEL_BUFFER_RTT; } 114 //while (arguments.read("--fb")) { renderImplementation = osg::Camera::FRAME_BUFFER; } 115 //while (arguments.read("--window")) { renderImplementation = osg::Camera::SEPERATE_WINDOW; } 116 117 //while (arguments.read("--texture-rectangle")) { useTextureRectangle = true; } 118 119 //while (arguments.read("--shaderDistortion")) { useShaderDistortion = true; } 120 121 //while (arguments.read("--hdr")) { useHDR = true; } 122 123 //while (arguments.read("--distortionmap", distortMapFileName)) { } 124 //while (arguments.read("--blendmap", blendMapFileName)) { } 83 125 84 126 std::string pre_cfg("..\\resources\\distortion\\view_");
Note: See TracChangeset
for help on using the changeset viewer.