- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgPlugins/dae/daeWMaterials.cpp
r12416 r13041 2 2 * Copyright 2006 Sony Computer Entertainment Inc. 3 3 * 4 * Licensed under the SCEA Shared Source License, Version 1.0 (the "License"); you may not use this 4 * Licensed under the SCEA Shared Source License, Version 1.0 (the "License"); you may not use this 5 5 * file except in compliance with the License. You may obtain a copy of the License at: 6 6 * http://research.scea.com/scea_shared_source_license.html 7 7 * 8 * Unless required by applicable law or agreed to in writing, software distributed under the License 9 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 10 * implied. See the License for the specific language governing permissions and limitations under the 11 * License. 8 * Unless required by applicable law or agreed to in writing, software distributed under the License 9 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 10 * implied. See the License for the specific language governing permissions and limitations under the 11 * License. 12 12 */ 13 13 … … 78 78 domEffect *effect = daeSafeCast< domEffect >( lib_effects->add( COLLADA_ELEMENT_EFFECT ) ); 79 79 std::string efName = name + "_effect"; 80 80 81 81 effect->setId( efName.c_str() ); 82 82 … … 143 143 domFx_sampler2D_common *sampler = daeSafeCast< domFx_sampler2D_common >( np->add( COLLADA_ELEMENT_SAMPLER2D ) ); 144 144 domFx_sampler2D_common_complexType::domSource *source = daeSafeCast< domFx_sampler2D_common_complexType::domSource >( sampler->add( COLLADA_ELEMENT_SOURCE ) ); 145 source->setValue( surfName.c_str() ); 145 source->setValue( surfName.c_str() ); 146 146 147 147 //set sampler state 148 148 domFx_sampler2D_common_complexType::domWrap_s *wrap_s = daeSafeCast< domFx_sampler2D_common_complexType::domWrap_s >( sampler->add( COLLADA_ELEMENT_WRAP_S ) ); 149 149 osg::Texture::WrapMode wrap = tex->getWrap( osg::Texture::WRAP_S ); 150 switch( wrap ) 150 switch( wrap ) 151 151 { 152 152 case osg::Texture::CLAMP: … … 170 170 domFx_sampler2D_common_complexType::domWrap_t *wrap_t = daeSafeCast< domFx_sampler2D_common_complexType::domWrap_t >( sampler->add( COLLADA_ELEMENT_WRAP_T ) ); 171 171 wrap = tex->getWrap( osg::Texture::WRAP_T ); 172 switch( wrap ) 172 switch( wrap ) 173 173 { 174 174 case osg::Texture::CLAMP: … … 273 273 const osg::Vec4 &sCol = osgmat->getSpecularFrontAndBack()?osgmat->getSpecular( osg::Material::FRONT_AND_BACK ):osgmat->getSpecular( osg::Material::FRONT ); 274 274 float shininess = osgmat->getShininessFrontAndBack()?osgmat->getShininess( osg::Material::FRONT_AND_BACK ):osgmat->getShininess( osg::Material::FRONT ); 275 275 276 276 domCommon_color_or_texture_type *cot = daeSafeCast< domCommon_color_or_texture_type >( phong->add( COLLADA_ELEMENT_EMISSION ) ); 277 277 domCommon_color_or_texture_type_complexType::domColor *col = daeSafeCast< domCommon_color_or_texture_type_complexType::domColor >( cot->add( COLLADA_ELEMENT_COLOR ) ); … … 288 288 col->getValue().append( aCol.a() ); 289 289 290 290 291 291 //### check if we really have a texture 292 292 if ( phong->getDiffuse() == NULL ) … … 302 302 { 303 303 cot = phong->getDiffuse(); 304 304 305 305 if (_pluginOptions.writeExtras) 306 306 { … … 395 395 ctt->setOpaque( FX_OPAQUE_ENUM_A_ONE ); 396 396 domCommon_color_or_texture_type_complexType::domTexture * dtex = daeSafeCast< domCommon_color_or_texture_type_complexType::domTexture >( ctt->add(COLLADA_ELEMENT_TEXTURE) ); 397 397 398 398 if (!_pluginOptions.earthTex) 399 399 { … … 406 406 dtex->setTexture( iName.c_str() ); 407 407 } 408 dtex->setTexcoord( "texcoord0" ); 408 dtex->setTexcoord( "texcoord0" ); 409 409 } 410 410 else
