1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 /*****************************************************************************\
40 *****************************************************************************
42 ** This file is automatically generated. **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
47 ** Do not change this file, changes should be done in the derived **
48 ** class ShaderShadowMapEngine!
50 *****************************************************************************
51 \*****************************************************************************/
57 #pragma warning(disable: 4355) // turn off 'this' : used in base member initializer list warning
58 #pragma warning(disable: 4290) // disable exception specification warning
61 #include "OSGConfig.h"
65 #include "OSGShaderProgram.h" // ShadowVertexProgram Class
67 #include "OSGShaderShadowMapEngineBase.h"
68 #include "OSGShaderShadowMapEngine.h"
70 #include <boost/bind.hpp>
74 /***************************************************************************\
76 \***************************************************************************/
78 /*! \class OSG::ShaderShadowMapEngine
82 /***************************************************************************\
83 * Field Documentation *
84 \***************************************************************************/
86 /*! \var ShaderProgram * ShaderShadowMapEngineBase::_sfShadowVertexProgram
87 Vertex program snippet to perform necessary calculations for shadow map
88 lookup. Currently not used.
91 /*! \var ShaderProgram * ShaderShadowMapEngineBase::_sfShadowFragmentProgram
92 Fragment program snippet to perform shadow map lookup.
93 Contains a function vec4 OSG_SSME_FP_calcShadow(vec4 fragPos) that returns
94 a shadow factor for the fragment with eye coordinate positoin fragPos.
97 /*! \var Int32 ShaderShadowMapEngineBase::_sfForceTextureUnit
98 Texture unit to use for the shadow texture (this is passed to the shader
102 /*! \var Real32 ShaderShadowMapEngineBase::_sfShadowNear
103 Near clipping plane value to use when rendering the shadow map.
104 Only used when not 0.f.
107 /*! \var Real32 ShaderShadowMapEngineBase::_sfShadowFar
108 Far clipping plane value to use when rendering the shadow map.
109 Only used when not 0.f.
113 /***************************************************************************\
114 * FieldType/FieldTrait Instantiation *
115 \***************************************************************************/
117 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
118 PointerType FieldTraits
<ShaderShadowMapEngine
*, nsOSG
>::_type(
119 "ShaderShadowMapEnginePtr",
120 "ShadowMapEnginePtr",
121 ShaderShadowMapEngine::getClassType(),
125 OSG_FIELDTRAITS_GETTYPE_NS(ShaderShadowMapEngine
*, nsOSG
)
127 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
128 ShaderShadowMapEngine
*,
131 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
132 ShaderShadowMapEngine
*,
135 /***************************************************************************\
136 * Field Description *
137 \***************************************************************************/
139 void ShaderShadowMapEngineBase::classDescInserter(TypeObject
&oType
)
141 FieldDescriptionBase
*pDesc
= NULL
;
144 pDesc
= new SFUnrecShaderProgramPtr::Description(
145 SFUnrecShaderProgramPtr::getClassType(),
146 "shadowVertexProgram",
147 "Vertex program snippet to perform necessary calculations for shadow map\n"
148 "lookup. Currently not used.\n",
149 ShadowVertexProgramFieldId
, ShadowVertexProgramFieldMask
,
151 (Field::SFDefaultFlags
| Field::FStdAccess
),
152 static_cast<FieldEditMethodSig
>(&ShaderShadowMapEngine::editHandleShadowVertexProgram
),
153 static_cast<FieldGetMethodSig
>(&ShaderShadowMapEngine::getHandleShadowVertexProgram
));
155 oType
.addInitialDesc(pDesc
);
157 pDesc
= new SFUnrecShaderProgramPtr::Description(
158 SFUnrecShaderProgramPtr::getClassType(),
159 "shadowFragmentProgram",
160 "Fragment program snippet to perform shadow map lookup.\n"
161 "Contains a function vec4 OSG_SSME_FP_calcShadow(vec4 fragPos) that returns\n"
162 "a shadow factor for the fragment with eye coordinate positoin fragPos.\n",
163 ShadowFragmentProgramFieldId
, ShadowFragmentProgramFieldMask
,
165 (Field::SFDefaultFlags
| Field::FStdAccess
),
166 static_cast<FieldEditMethodSig
>(&ShaderShadowMapEngine::editHandleShadowFragmentProgram
),
167 static_cast<FieldGetMethodSig
>(&ShaderShadowMapEngine::getHandleShadowFragmentProgram
));
169 oType
.addInitialDesc(pDesc
);
171 pDesc
= new SFInt32::Description(
172 SFInt32::getClassType(),
174 "Texture unit to use for the shadow texture (this is passed to the shader\n"
176 ForceTextureUnitFieldId
, ForceTextureUnitFieldMask
,
178 (Field::SFDefaultFlags
| Field::FStdAccess
),
179 static_cast<FieldEditMethodSig
>(&ShaderShadowMapEngine::editHandleForceTextureUnit
),
180 static_cast<FieldGetMethodSig
>(&ShaderShadowMapEngine::getHandleForceTextureUnit
));
182 oType
.addInitialDesc(pDesc
);
184 pDesc
= new SFReal32::Description(
185 SFReal32::getClassType(),
187 "Near clipping plane value to use when rendering the shadow map.\n"
188 "Only used when not 0.f.\n",
189 ShadowNearFieldId
, ShadowNearFieldMask
,
191 (Field::SFDefaultFlags
| Field::FStdAccess
),
192 static_cast<FieldEditMethodSig
>(&ShaderShadowMapEngine::editHandleShadowNear
),
193 static_cast<FieldGetMethodSig
>(&ShaderShadowMapEngine::getHandleShadowNear
));
195 oType
.addInitialDesc(pDesc
);
197 pDesc
= new SFReal32::Description(
198 SFReal32::getClassType(),
200 "Far clipping plane value to use when rendering the shadow map.\n"
201 "Only used when not 0.f.\n",
202 ShadowFarFieldId
, ShadowFarFieldMask
,
204 (Field::SFDefaultFlags
| Field::FStdAccess
),
205 static_cast<FieldEditMethodSig
>(&ShaderShadowMapEngine::editHandleShadowFar
),
206 static_cast<FieldGetMethodSig
>(&ShaderShadowMapEngine::getHandleShadowFar
));
208 oType
.addInitialDesc(pDesc
);
212 ShaderShadowMapEngineBase::TypeObject
ShaderShadowMapEngineBase::_type(
213 ShaderShadowMapEngineBase::getClassname(),
214 Inherited::getClassname(),
217 reinterpret_cast<PrototypeCreateF
>(&ShaderShadowMapEngineBase::createEmptyLocal
),
218 reinterpret_cast<InitContainerF
>(&ShaderShadowMapEngine::initMethod
),
219 reinterpret_cast<ExitContainerF
>(&ShaderShadowMapEngine::exitMethod
),
220 reinterpret_cast<InitalInsertDescFunc
>(
221 reinterpret_cast<void *>(&ShaderShadowMapEngine::classDescInserter
)),
224 "<?xml version=\"1.0\" ?>\n"
227 " name=\"ShaderShadowMapEngine\"\n"
228 " parent=\"ShadowMapEngine\"\n"
229 " library=\"Group\"\n"
230 " structure=\"concrete\"\n"
231 " pointerfieldtypes=\"both\"\n"
232 " systemcomponent=\"true\"\n"
233 " parentsystemcomponent=\"true\"\n"
234 " isNodeCore=\"false\"\n"
235 " docGroupBase=\"GrpGroupLightShadowEngines\"\n"
238 " name=\"shadowVertexProgram\"\n"
239 " category=\"pointer\"\n"
240 " type=\"ShaderProgram\"\n"
241 " cardinality=\"single\"\n"
242 " visibility=\"external\"\n"
243 " defaultValue=\"NULL\"\n"
244 " access=\"public\"\n"
246 " Vertex program snippet to perform necessary calculations for shadow map\n"
247 " lookup. Currently not used.\n"
250 " name=\"shadowFragmentProgram\"\n"
251 " category=\"pointer\"\n"
252 " type=\"ShaderProgram\"\n"
253 " cardinality=\"single\"\n"
254 " visibility=\"external\"\n"
255 " defaultValue=\"NULL\"\n"
256 " access=\"public\"\n"
258 " Fragment program snippet to perform shadow map lookup.\n"
259 " Contains a function vec4 OSG_SSME_FP_calcShadow(vec4 fragPos) that returns\n"
260 " a shadow factor for the fragment with eye coordinate positoin fragPos.\n"
263 " name=\"forceTextureUnit\"\n"
265 " cardinality=\"single\"\n"
266 " visibility=\"external\"\n"
267 " defaultValue=\"-1\"\n"
268 " access=\"public\"\n"
270 " Texture unit to use for the shadow texture (this is passed to the shader\n"
274 " name=\"shadowNear\"\n"
276 " category=\"data\"\n"
277 " cardinality=\"single\"\n"
278 " visibility=\"external\"\n"
279 " defaultValue=\"0.f\"\n"
280 " access=\"public\"\n"
282 " Near clipping plane value to use when rendering the shadow map.\n"
283 " Only used when not 0.f.\n"
286 " name=\"shadowFar\"\n"
288 " category=\"data\"\n"
289 " cardinality=\"single\"\n"
290 " visibility=\"external\"\n"
291 " defaultValue=\"0.f\"\n"
292 " access=\"public\"\n"
294 " Far clipping plane value to use when rendering the shadow map.\n"
295 " Only used when not 0.f.\n"
297 "</FieldContainer>\n",
301 /*------------------------------ get -----------------------------------*/
303 FieldContainerType
&ShaderShadowMapEngineBase::getType(void)
308 const FieldContainerType
&ShaderShadowMapEngineBase::getType(void) const
313 UInt32
ShaderShadowMapEngineBase::getContainerSize(void) const
315 return sizeof(ShaderShadowMapEngine
);
318 /*------------------------- decorator get ------------------------------*/
321 //! Get the ShaderShadowMapEngine::_sfShadowVertexProgram field.
322 const SFUnrecShaderProgramPtr
*ShaderShadowMapEngineBase::getSFShadowVertexProgram(void) const
324 return &_sfShadowVertexProgram
;
327 SFUnrecShaderProgramPtr
*ShaderShadowMapEngineBase::editSFShadowVertexProgram(void)
329 editSField(ShadowVertexProgramFieldMask
);
331 return &_sfShadowVertexProgram
;
334 //! Get the value of the ShaderShadowMapEngine::_sfShadowVertexProgram field.
335 ShaderProgram
* ShaderShadowMapEngineBase::getShadowVertexProgram(void) const
337 return _sfShadowVertexProgram
.getValue();
340 //! Set the value of the ShaderShadowMapEngine::_sfShadowVertexProgram field.
341 void ShaderShadowMapEngineBase::setShadowVertexProgram(ShaderProgram
* const value
)
343 editSField(ShadowVertexProgramFieldMask
);
345 _sfShadowVertexProgram
.setValue(value
);
349 //! Get the ShaderShadowMapEngine::_sfShadowFragmentProgram field.
350 const SFUnrecShaderProgramPtr
*ShaderShadowMapEngineBase::getSFShadowFragmentProgram(void) const
352 return &_sfShadowFragmentProgram
;
355 SFUnrecShaderProgramPtr
*ShaderShadowMapEngineBase::editSFShadowFragmentProgram(void)
357 editSField(ShadowFragmentProgramFieldMask
);
359 return &_sfShadowFragmentProgram
;
362 //! Get the value of the ShaderShadowMapEngine::_sfShadowFragmentProgram field.
363 ShaderProgram
* ShaderShadowMapEngineBase::getShadowFragmentProgram(void) const
365 return _sfShadowFragmentProgram
.getValue();
368 //! Set the value of the ShaderShadowMapEngine::_sfShadowFragmentProgram field.
369 void ShaderShadowMapEngineBase::setShadowFragmentProgram(ShaderProgram
* const value
)
371 editSField(ShadowFragmentProgramFieldMask
);
373 _sfShadowFragmentProgram
.setValue(value
);
377 SFInt32
*ShaderShadowMapEngineBase::editSFForceTextureUnit(void)
379 editSField(ForceTextureUnitFieldMask
);
381 return &_sfForceTextureUnit
;
384 const SFInt32
*ShaderShadowMapEngineBase::getSFForceTextureUnit(void) const
386 return &_sfForceTextureUnit
;
390 SFReal32
*ShaderShadowMapEngineBase::editSFShadowNear(void)
392 editSField(ShadowNearFieldMask
);
394 return &_sfShadowNear
;
397 const SFReal32
*ShaderShadowMapEngineBase::getSFShadowNear(void) const
399 return &_sfShadowNear
;
403 SFReal32
*ShaderShadowMapEngineBase::editSFShadowFar(void)
405 editSField(ShadowFarFieldMask
);
407 return &_sfShadowFar
;
410 const SFReal32
*ShaderShadowMapEngineBase::getSFShadowFar(void) const
412 return &_sfShadowFar
;
420 /*------------------------------ access -----------------------------------*/
422 SizeT
ShaderShadowMapEngineBase::getBinSize(ConstFieldMaskArg whichField
)
424 SizeT returnValue
= Inherited::getBinSize(whichField
);
426 if(FieldBits::NoField
!= (ShadowVertexProgramFieldMask
& whichField
))
428 returnValue
+= _sfShadowVertexProgram
.getBinSize();
430 if(FieldBits::NoField
!= (ShadowFragmentProgramFieldMask
& whichField
))
432 returnValue
+= _sfShadowFragmentProgram
.getBinSize();
434 if(FieldBits::NoField
!= (ForceTextureUnitFieldMask
& whichField
))
436 returnValue
+= _sfForceTextureUnit
.getBinSize();
438 if(FieldBits::NoField
!= (ShadowNearFieldMask
& whichField
))
440 returnValue
+= _sfShadowNear
.getBinSize();
442 if(FieldBits::NoField
!= (ShadowFarFieldMask
& whichField
))
444 returnValue
+= _sfShadowFar
.getBinSize();
450 void ShaderShadowMapEngineBase::copyToBin(BinaryDataHandler
&pMem
,
451 ConstFieldMaskArg whichField
)
453 Inherited::copyToBin(pMem
, whichField
);
455 if(FieldBits::NoField
!= (ShadowVertexProgramFieldMask
& whichField
))
457 _sfShadowVertexProgram
.copyToBin(pMem
);
459 if(FieldBits::NoField
!= (ShadowFragmentProgramFieldMask
& whichField
))
461 _sfShadowFragmentProgram
.copyToBin(pMem
);
463 if(FieldBits::NoField
!= (ForceTextureUnitFieldMask
& whichField
))
465 _sfForceTextureUnit
.copyToBin(pMem
);
467 if(FieldBits::NoField
!= (ShadowNearFieldMask
& whichField
))
469 _sfShadowNear
.copyToBin(pMem
);
471 if(FieldBits::NoField
!= (ShadowFarFieldMask
& whichField
))
473 _sfShadowFar
.copyToBin(pMem
);
477 void ShaderShadowMapEngineBase::copyFromBin(BinaryDataHandler
&pMem
,
478 ConstFieldMaskArg whichField
)
480 Inherited::copyFromBin(pMem
, whichField
);
482 if(FieldBits::NoField
!= (ShadowVertexProgramFieldMask
& whichField
))
484 editSField(ShadowVertexProgramFieldMask
);
485 _sfShadowVertexProgram
.copyFromBin(pMem
);
487 if(FieldBits::NoField
!= (ShadowFragmentProgramFieldMask
& whichField
))
489 editSField(ShadowFragmentProgramFieldMask
);
490 _sfShadowFragmentProgram
.copyFromBin(pMem
);
492 if(FieldBits::NoField
!= (ForceTextureUnitFieldMask
& whichField
))
494 editSField(ForceTextureUnitFieldMask
);
495 _sfForceTextureUnit
.copyFromBin(pMem
);
497 if(FieldBits::NoField
!= (ShadowNearFieldMask
& whichField
))
499 editSField(ShadowNearFieldMask
);
500 _sfShadowNear
.copyFromBin(pMem
);
502 if(FieldBits::NoField
!= (ShadowFarFieldMask
& whichField
))
504 editSField(ShadowFarFieldMask
);
505 _sfShadowFar
.copyFromBin(pMem
);
509 //! create a new instance of the class
510 ShaderShadowMapEngineTransitPtr
ShaderShadowMapEngineBase::createLocal(BitVector bFlags
)
512 ShaderShadowMapEngineTransitPtr fc
;
514 if(getClassType().getPrototype() != NULL
)
516 FieldContainerTransitPtr tmpPtr
=
517 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
519 fc
= dynamic_pointer_cast
<ShaderShadowMapEngine
>(tmpPtr
);
525 //! create a new instance of the class, copy the container flags
526 ShaderShadowMapEngineTransitPtr
ShaderShadowMapEngineBase::createDependent(BitVector bFlags
)
528 ShaderShadowMapEngineTransitPtr fc
;
530 if(getClassType().getPrototype() != NULL
)
532 FieldContainerTransitPtr tmpPtr
=
533 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
535 fc
= dynamic_pointer_cast
<ShaderShadowMapEngine
>(tmpPtr
);
541 //! create a new instance of the class
542 ShaderShadowMapEngineTransitPtr
ShaderShadowMapEngineBase::create(void)
544 ShaderShadowMapEngineTransitPtr fc
;
546 if(getClassType().getPrototype() != NULL
)
548 FieldContainerTransitPtr tmpPtr
=
549 getClassType().getPrototype()-> shallowCopy();
551 fc
= dynamic_pointer_cast
<ShaderShadowMapEngine
>(tmpPtr
);
557 ShaderShadowMapEngine
*ShaderShadowMapEngineBase::createEmptyLocal(BitVector bFlags
)
559 ShaderShadowMapEngine
*returnValue
;
561 newPtr
<ShaderShadowMapEngine
>(returnValue
, bFlags
);
563 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
568 //! create an empty new instance of the class, do not copy the prototype
569 ShaderShadowMapEngine
*ShaderShadowMapEngineBase::createEmpty(void)
571 ShaderShadowMapEngine
*returnValue
;
573 newPtr
<ShaderShadowMapEngine
>(returnValue
, Thread::getCurrentLocalFlags());
575 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
576 ~Thread::getCurrentLocalFlags();
582 FieldContainerTransitPtr
ShaderShadowMapEngineBase::shallowCopyLocal(
583 BitVector bFlags
) const
585 ShaderShadowMapEngine
*tmpPtr
;
587 newPtr(tmpPtr
, dynamic_cast<const ShaderShadowMapEngine
*>(this), bFlags
);
589 FieldContainerTransitPtr
returnValue(tmpPtr
);
591 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
596 FieldContainerTransitPtr
ShaderShadowMapEngineBase::shallowCopyDependent(
597 BitVector bFlags
) const
599 ShaderShadowMapEngine
*tmpPtr
;
601 newPtr(tmpPtr
, dynamic_cast<const ShaderShadowMapEngine
*>(this), ~bFlags
);
603 FieldContainerTransitPtr
returnValue(tmpPtr
);
605 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
610 FieldContainerTransitPtr
ShaderShadowMapEngineBase::shallowCopy(void) const
612 ShaderShadowMapEngine
*tmpPtr
;
615 dynamic_cast<const ShaderShadowMapEngine
*>(this),
616 Thread::getCurrentLocalFlags());
618 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
620 FieldContainerTransitPtr
returnValue(tmpPtr
);
628 /*------------------------- constructors ----------------------------------*/
630 ShaderShadowMapEngineBase::ShaderShadowMapEngineBase(void) :
632 _sfShadowVertexProgram (NULL
),
633 _sfShadowFragmentProgram (NULL
),
634 _sfForceTextureUnit (Int32(-1)),
635 _sfShadowNear (Real32(0.f
)),
636 _sfShadowFar (Real32(0.f
))
640 ShaderShadowMapEngineBase::ShaderShadowMapEngineBase(const ShaderShadowMapEngineBase
&source
) :
642 _sfShadowVertexProgram (NULL
),
643 _sfShadowFragmentProgram (NULL
),
644 _sfForceTextureUnit (source
._sfForceTextureUnit
),
645 _sfShadowNear (source
._sfShadowNear
),
646 _sfShadowFar (source
._sfShadowFar
)
651 /*-------------------------- destructors ----------------------------------*/
653 ShaderShadowMapEngineBase::~ShaderShadowMapEngineBase(void)
657 void ShaderShadowMapEngineBase::onCreate(const ShaderShadowMapEngine
*source
)
659 Inherited::onCreate(source
);
663 ShaderShadowMapEngine
*pThis
= static_cast<ShaderShadowMapEngine
*>(this);
665 pThis
->setShadowVertexProgram(source
->getShadowVertexProgram());
667 pThis
->setShadowFragmentProgram(source
->getShadowFragmentProgram());
671 GetFieldHandlePtr
ShaderShadowMapEngineBase::getHandleShadowVertexProgram (void) const
673 SFUnrecShaderProgramPtr::GetHandlePtr
returnValue(
674 new SFUnrecShaderProgramPtr::GetHandle(
675 &_sfShadowVertexProgram
,
676 this->getType().getFieldDesc(ShadowVertexProgramFieldId
),
677 const_cast<ShaderShadowMapEngineBase
*>(this)));
682 EditFieldHandlePtr
ShaderShadowMapEngineBase::editHandleShadowVertexProgram(void)
684 SFUnrecShaderProgramPtr::EditHandlePtr
returnValue(
685 new SFUnrecShaderProgramPtr::EditHandle(
686 &_sfShadowVertexProgram
,
687 this->getType().getFieldDesc(ShadowVertexProgramFieldId
),
690 returnValue
->setSetMethod(
691 boost::bind(&ShaderShadowMapEngine::setShadowVertexProgram
,
692 static_cast<ShaderShadowMapEngine
*>(this), _1
));
694 editSField(ShadowVertexProgramFieldMask
);
699 GetFieldHandlePtr
ShaderShadowMapEngineBase::getHandleShadowFragmentProgram (void) const
701 SFUnrecShaderProgramPtr::GetHandlePtr
returnValue(
702 new SFUnrecShaderProgramPtr::GetHandle(
703 &_sfShadowFragmentProgram
,
704 this->getType().getFieldDesc(ShadowFragmentProgramFieldId
),
705 const_cast<ShaderShadowMapEngineBase
*>(this)));
710 EditFieldHandlePtr
ShaderShadowMapEngineBase::editHandleShadowFragmentProgram(void)
712 SFUnrecShaderProgramPtr::EditHandlePtr
returnValue(
713 new SFUnrecShaderProgramPtr::EditHandle(
714 &_sfShadowFragmentProgram
,
715 this->getType().getFieldDesc(ShadowFragmentProgramFieldId
),
718 returnValue
->setSetMethod(
719 boost::bind(&ShaderShadowMapEngine::setShadowFragmentProgram
,
720 static_cast<ShaderShadowMapEngine
*>(this), _1
));
722 editSField(ShadowFragmentProgramFieldMask
);
727 GetFieldHandlePtr
ShaderShadowMapEngineBase::getHandleForceTextureUnit (void) const
729 SFInt32::GetHandlePtr
returnValue(
730 new SFInt32::GetHandle(
731 &_sfForceTextureUnit
,
732 this->getType().getFieldDesc(ForceTextureUnitFieldId
),
733 const_cast<ShaderShadowMapEngineBase
*>(this)));
738 EditFieldHandlePtr
ShaderShadowMapEngineBase::editHandleForceTextureUnit(void)
740 SFInt32::EditHandlePtr
returnValue(
741 new SFInt32::EditHandle(
742 &_sfForceTextureUnit
,
743 this->getType().getFieldDesc(ForceTextureUnitFieldId
),
747 editSField(ForceTextureUnitFieldMask
);
752 GetFieldHandlePtr
ShaderShadowMapEngineBase::getHandleShadowNear (void) const
754 SFReal32::GetHandlePtr
returnValue(
755 new SFReal32::GetHandle(
757 this->getType().getFieldDesc(ShadowNearFieldId
),
758 const_cast<ShaderShadowMapEngineBase
*>(this)));
763 EditFieldHandlePtr
ShaderShadowMapEngineBase::editHandleShadowNear (void)
765 SFReal32::EditHandlePtr
returnValue(
766 new SFReal32::EditHandle(
768 this->getType().getFieldDesc(ShadowNearFieldId
),
772 editSField(ShadowNearFieldMask
);
777 GetFieldHandlePtr
ShaderShadowMapEngineBase::getHandleShadowFar (void) const
779 SFReal32::GetHandlePtr
returnValue(
780 new SFReal32::GetHandle(
782 this->getType().getFieldDesc(ShadowFarFieldId
),
783 const_cast<ShaderShadowMapEngineBase
*>(this)));
788 EditFieldHandlePtr
ShaderShadowMapEngineBase::editHandleShadowFar (void)
790 SFReal32::EditHandlePtr
returnValue(
791 new SFReal32::EditHandle(
793 this->getType().getFieldDesc(ShadowFarFieldId
),
797 editSField(ShadowFarFieldMask
);
803 #ifdef OSG_MT_CPTR_ASPECT
804 void ShaderShadowMapEngineBase::execSyncV( FieldContainer
&oFrom
,
805 ConstFieldMaskArg whichField
,
806 AspectOffsetStore
&oOffsets
,
807 ConstFieldMaskArg syncMode
,
808 const UInt32 uiSyncInfo
)
810 ShaderShadowMapEngine
*pThis
= static_cast<ShaderShadowMapEngine
*>(this);
812 pThis
->execSync(static_cast<ShaderShadowMapEngine
*>(&oFrom
),
821 #ifdef OSG_MT_CPTR_ASPECT
822 FieldContainer
*ShaderShadowMapEngineBase::createAspectCopy(
823 const FieldContainer
*pRefAspect
) const
825 ShaderShadowMapEngine
*returnValue
;
827 newAspectCopy(returnValue
,
828 dynamic_cast<const ShaderShadowMapEngine
*>(pRefAspect
),
829 dynamic_cast<const ShaderShadowMapEngine
*>(this));
835 void ShaderShadowMapEngineBase::resolveLinks(void)
837 Inherited::resolveLinks();
839 static_cast<ShaderShadowMapEngine
*>(this)->setShadowVertexProgram(NULL
);
841 static_cast<ShaderShadowMapEngine
*>(this)->setShadowFragmentProgram(NULL
);