Go to the
documentation of this file.
00001
00002
00003
00004
00005
00006
00007
00008
00009 #pragma once
00010
00011
00012 #include "maxheap.h"
00013 #include "sfx.h"
00014
00015
00016 class IllumParams;
00017 namespace MaxSDK
00018 {
00019 namespace AssetManagement
00020 {
00021 class AssetUser;
00022 }
00023 }
00024
00025
00026 #define BEAUTY_RENDER_ELEMENT_CLASS_ID 0x00000001
00027
00028 #define SHADOWS_RENDER_ELEMENT_CLASS_ID 0x00000008
00029 #define Z_RENDER_ELEMENT_CLASS_ID 0x0000000c
00030 #define ALPHA_RENDER_ELEMENT_CLASS_ID 0x0000000d
00031 #define LIGHTING_RENDER_ELEMENT_CLASS_ID 0x00000011
00032 #define MATERIALID_RENDER_ELEMENT_CLASS_ID 0x00000014
00033 #define OBJECTID_RENDER_ELEMENT_CLASS_ID 0x00000015
00034 #define ILLUMINANCE_RENDER_ELEMENT_CLASS_ID 0x00000017
00035
00036
00037
00038 typedef SFXParamDlg IRenderElementParamDlg;
00039
00040
00042
00043
00044
00045
00046
00058 #pragma warning(push)
00059 #pragma warning(disable:4100)
00060 class IRenderElement : public SpecialFX
00061 {
00062 public:
00063
00068 virtual void SetEnabled(BOOL enabled)=0;
00071 virtual BOOL IsEnabled() const = 0;
00072
00073
00080 virtual void SetFilterEnabled(BOOL filterEnabled)=0;
00086 virtual BOOL IsFilterEnabled() const =0;
00087
00088
00098 virtual BOOL BlendOnMultipass() const =0;
00099
00102 virtual BOOL AtmosphereApplied() const =0;
00103
00106 virtual BOOL ShadowsApplied() const =0;
00107
00108
00114 virtual void SetElementName( const MCHAR* newName )=0;
00115
00116
00117 virtual void SetElementName( MCHAR* newName ) { SetElementName(const_cast<const MCHAR*>(newName)); }
00118
00121 virtual const MCHAR* ElementName() const =0;
00122
00133 virtual void SetPBBitmap(PBBitmap* &pPBBitmap) const =0;
00139 virtual void GetPBBitmap(PBBitmap* &pPBBitmap) const =0;
00140
00141
00152 virtual IRenderElementParamDlg *CreateParamDialog(IRendParams *ip) { return NULL; }
00153
00154
00155
00156
00157
00170 virtual BOOL SetDlgThing(IRenderElementParamDlg* dlg) { return FALSE; }
00171
00172
00173
00174
00175
00176
00177
00178
00194 IOResult Save(ISave *iSave)
00195 {
00196 name = ElementName();
00197 return SpecialFX::Save(iSave);
00198 }
00211 IOResult Load(ILoad *iLoad)
00212 {
00213 return SpecialFX::Load(iLoad);
00214 }
00215
00240 virtual RefResult NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message) { return REF_SUCCEED; }
00241
00242
00243
00244
00248 SClass_ID SuperClassID() { return RENDER_ELEMENT_CLASS_ID; }
00249
00250
00251 using SpecialFX::GetInterface;
00265 virtual void* GetInterface(ULONG id) =0;
00266
00270 virtual void ReleaseInterface(ULONG id, void *i) =0;
00271 };
00272
00273
00274
00275
00276
00277
00279 #define IRENDERELEMENTREQUIREMENTS_INTERFACE_ID Interface_ID(0x1804343c, 0x614c2fdf)
00280 class IRenderElementRequirements : public BaseInterface {
00281 public:
00282
00284 enum Requirement {
00285 kRequirement_MotionData = 0
00286 };
00287
00291 virtual bool HasRequirement(Requirement requirement) = 0;
00292
00293
00295 virtual Interface_ID GetID();
00296 };
00297
00298 inline Interface_ID IRenderElementRequirements::GetID() {
00299
00300 return IRENDERELEMENTREQUIREMENTS_INTERFACE_ID;
00301 }
00302
00304
00309 inline IRenderElementRequirements* Get_RenderElementRequirements(IRenderElement* element) {
00310
00311 return (element != NULL) ? static_cast<IRenderElementRequirements*>(element->GetInterface(IRENDERELEMENTREQUIREMENTS_INTERFACE_ID)) : NULL;
00312 }
00313
00315
00316
00317
00318
00319
00320
00341 class MaxRenderElement : public IRenderElement
00342 {
00343 friend class FilterComp;
00344 protected:
00345 int mShadeOutputIndex;
00346
00347 public:
00348
00349 enum { IID = 0xeffeeffe };
00350
00351
00361 void SetShadeOutputIndex(int shadeOutputIndex) { mShadeOutputIndex = shadeOutputIndex; }
00368 int ShadeOutputIndex() const { return mShadeOutputIndex; }
00369
00370
00381 virtual void Update(TimeValue timeValue) { }
00382
00383
00410 virtual void PostIllum(ShadeContext& sc, IllumParams& ip) =0;
00411
00412
00435 virtual void PostAtmosphere(ShadeContext& sc, float z, float prevZ) =0;
00436
00437
00438
00439
00440
00441 using IRenderElement::GetInterface;
00453 virtual void* GetInterface(ULONG id){ return (id == IID) ? this : SpecialFX::GetInterface(id);}
00457 virtual void ReleaseInterface(ULONG id, void *i) { }
00458 };
00459
00460 #pragma warning(pop)
00461
00462
00463
00464
00465
00480 class MaxBakeElement : public MaxRenderElement
00481 {
00482
00483 public:
00484
00485 enum { IID = 0xeffeefff };
00486
00487
00488
00497 virtual void SetOutputSz( int xSz, int ySz ) = 0;
00506 virtual void GetOutputSz( int& xSz, int& ySz ) const = 0;
00507
00515 virtual void SetFileName( const MCHAR* newName) = 0;
00516
00517
00518 virtual void SetFileName( MCHAR* newName) { SetFileName(const_cast<const MCHAR*>(newName)); }
00519
00522 virtual const MCHAR* GetFileName() const = 0;
00532 virtual void SetFileType( const MCHAR* newType) = 0;
00533
00534
00535 virtual void SetFileType( MCHAR* newType) { SetFileType(const_cast<const MCHAR*>(newType)); }
00536
00540 virtual const MCHAR* GetFileType() const = 0;
00541
00543 virtual void SetFileNameUnique(BOOL on) = 0;
00545 virtual BOOL IsFileNameUnique() const = 0;
00546
00547
00548
00557 virtual void SetRenderBitmap( Bitmap* pBitmap ) = 0;
00560 virtual Bitmap* GetRenderBitmap() const = 0;
00561
00562
00563
00572 virtual void SetLightApplied(BOOL on) = 0;
00575 virtual BOOL IsLightApplied() const = 0;
00576
00577
00586 virtual void SetShadowApplied(BOOL on) = 0;
00590 virtual BOOL IsShadowApplied() const = 0;
00591
00592
00593
00601 virtual void SetAtmosphereApplied(BOOL on) = 0;
00605 virtual BOOL IsAtmosphereApplied() const = 0;
00606
00607
00608 virtual BOOL AtmosphereApplied() const {
00609 return IsAtmosphereApplied();
00610 }
00611 virtual BOOL ShadowsApplied() const {
00612 return IsShadowApplied();
00613 }
00614
00615
00616
00617
00620 virtual int GetNParams() const = 0;
00629 virtual const MCHAR* GetParamName( int nParam ) = 0;
00642 virtual const int FindParamByName( MCHAR* name ) = 0;
00651 virtual int GetParamType( int nParam ) = 0;
00659 virtual int GetParamValue( int nParam ) = 0;
00666 virtual void SetParamValue( int nParam, int newVal ) = 0;
00667
00668
00669
00670
00671 SClass_ID SuperClassID() { return BAKE_ELEMENT_CLASS_ID; }
00672
00673
00674 using MaxRenderElement::GetInterface;
00675 virtual void* GetInterface(ULONG id){ return (id == IID) ? this : MaxRenderElement::GetInterface(id);}
00676
00677 virtual void ReleaseInterface(ULONG id, void *i) { UNUSED_PARAM(id); UNUSED_PARAM(i); }
00678 };
00679
00681
00683
00686 class MaxBakeElement8 : public MaxBakeElement
00687 {
00688 public:
00690 enum { IID = 0x1f2203c5 };
00691
00693
00695 virtual int GetParamType( int nParam ) = 0;
00696
00698
00700 virtual FPValue GetParamFPValue( int nParam ) = 0;
00701
00703
00705 virtual void SetParamFPValue( int nParam, FPValue newVal ) = 0;
00706
00707
00709
00711 virtual FPValue GetParamFPValueMin( int nParam ) = 0;
00712
00714
00716 virtual FPValue GetParamFPValueMax( int nParam ) = 0;
00717
00718
00719
00720
00721 using MaxBakeElement::GetInterface;
00723 virtual void* GetInterface(ULONG id){ return (id == IID) ? this : MaxBakeElement::GetInterface(id);}
00724
00725 };
00726
00728
00730
00731 class MaxBakeElement10 : public MaxBakeElement8
00732 {
00733 public:
00735 enum { IID = 0x3b6566df };
00736
00738
00739 virtual AColor GetBackgroundColor( ) = 0;
00740
00742
00743 virtual void SetBackgroundColor( AColor color ) = 0;
00744
00745
00746
00747
00748 using MaxBakeElement::GetInterface;
00750 virtual void* GetInterface(ULONG id){ return (id == IID) ? this : MaxBakeElement8::GetInterface(id);}
00751
00752 };
00753
00755
00756
00757
00758
00759
00760
00761
00762
00763
00764
00765
00766
00767
00768
00769
00770
00784 class IRenderElementCompatible: public MaxHeapOperators
00785 {
00786 public:
00787
00788 enum { IID = 0xcafeface };
00789
00796 virtual BOOL IsCompatible(IRenderElement *pIRenderElement) = 0;
00797 };
00798
00799
00801
00802
00803
00804 #define IREND_ELEM_MGR_INTERFACE Interface_ID(0x95791767, 0x17651746)
00805
00806
00813 class IRenderElementMgr : public FPMixinInterface
00814 {
00815 public:
00816
00817
00824 virtual BOOL AppendMergedRenderElement(IRenderElement *pRenderElement) = 0;
00832 virtual BOOL AppendMergedRenderElement(ReferenceTarget *pRenderElement) = 0;
00833
00834
00841 virtual BOOL AddRenderElement(IRenderElement *pRenderElement) = 0;
00848 virtual BOOL AddRenderElement(ReferenceTarget *pRenderElement) = 0;
00849 virtual BOOL RemoveRenderElement(IRenderElement *pRenderElement) = 0;
00856 virtual BOOL RemoveRenderElement(ReferenceTarget *pRenderElement) = 0;
00859 virtual void RemoveAllRenderElements() = 0;
00860
00861
00864 virtual int NumRenderElements() = 0;
00865
00866
00874 virtual IRenderElement *GetRenderElement(int index) = 0;
00875
00876
00882 virtual void SetElementsActive(BOOL elementsActive) = 0;
00885 virtual BOOL GetElementsActive() const = 0;
00886
00887
00893 virtual void SetDisplayElements(BOOL displayElements) = 0;
00897 virtual BOOL GetDisplayElements() const = 0;
00898
00899
00905 virtual void SetCombustionOutputEnabled(BOOL combustionOutEnabled) = 0;
00909 virtual BOOL GetCombustionOutputEnabled() const = 0;
00910
00916 virtual void SetCombustionOutput(const MaxSDK::AssetManagement::AssetUser& combustionOutputPath) = 0;
00919 virtual const MaxSDK::AssetManagement::AssetUser& GetCombustionOutput() const = 0;
00920
00921
00922 #ifndef NO_RENDER_ELEMENTS
00923
00924 enum
00925 {
00926 fps_AddRenderElement, fps_RemoveRenderElement, fps_RemoveAllRenderElements,
00927 fps_NumRenderElements, fps_GetRenderElement,
00928 fps_SetElementsActive, fps_GetElementsActive,
00929 fps_SetDisplayElements, fps_GetDisplayElements,
00930 fps_SetCombustionOutputEnabled, fps_GetCombustionOutputEnabled,
00931 fps_SetCombustionOutputPath, fps_GetCombustionOutputPath,
00932 fps_SetRenderElementFilename, fps_GetRenderElementFilename,
00933 };
00934 #endif // NO_RENDER_ELEMENTS
00935
00936 };
00937