Go to the
documentation of this file.
00001
00002
00003
00004
00005
00006
00007
00008 #pragma once
00009
00010 #include <WTypes.h>
00011 #include "sfx.h"
00012
00013 class ShadeOutput;
00014 class ShadeContext;
00015
00016
00017 #define R25_SAMPLER_CLASS_ID 0x25773211
00018 #define DEFAULT_SAMPLER_CLASS_ID R25_SAMPLER_CLASS_ID
00019
00020 typedef ULONG MASK[2];
00021 typedef SFXParamDlg SamplerParamDlg;
00022
00029 class SamplingCallback : public InterfaceServer {
00030 public:
00045 virtual BOOL SampleAtOffset( ShadeOutput* pOut, Point2& sample, float sampleScale )=0;
00046 };
00047
00048 class StdMat2;
00049
00084 class Sampler : public SpecialFX {
00085 public:
00086 #pragma warning(push)
00087 #pragma warning(disable:4100)
00088 RefResult NotifyRefChanged(
00089 Interval changeInt,
00090 RefTargetHandle hTarget,
00091 PartID& partID,
00092 RefMessage message ) { return REF_SUCCEED; }
00093
00094 SClass_ID SuperClassID() { return SAMPLER_CLASS_ID; }
00095
00096
00097
00104 IOResult Save(ISave *isave) { return SpecialFX::Save(isave); }
00111 IOResult Load(ILoad *iload) { return SpecialFX::Load(iload); }
00112
00265 virtual void DoSamples(
00266 ShadeOutput* pOut,
00267 SamplingCallback* cb,
00268 ShadeContext* sc,
00269 MASK mask = NULL) = 0;
00270
00271
00276 virtual int GetNSamples()=0;
00277
00278
00279
00280
00281
00287 virtual void SetQuality( float value )=0;
00295 virtual float GetQuality()=0;
00296
00299 virtual int SupportsQualityLevels()=0;
00300
00305 virtual void SetEnable( BOOL samplingOn )=0;
00307 virtual BOOL GetEnable()=0;
00308
00311 virtual MCHAR* GetDefaultComment()=0;
00312
00313
00314
00334 virtual ULONG SupportsStdParams(){ return 0; }
00335
00336
00337
00347 virtual void SetTextureSuperSampleOn( BOOL on ){}
00352 virtual BOOL GetTextureSuperSampleOn(){ return FALSE; }
00353
00361 virtual void SetAdaptiveOn( BOOL on ){}
00366 virtual BOOL IsAdaptiveOn(){ return FALSE; }
00367
00375 virtual void SetAdaptiveThreshold( float value ){}
00379 virtual float GetAdaptiveThreshold(){ return 0.0f; }
00380
00381
00387 virtual long GetNOptionalParams(){ return 0; }
00395 virtual MCHAR * GetOptionalParamName( long nParam ){ return _M(""); }
00404 virtual float GetOptionalParamMax( long nParam ){ return 1.0f; }
00412 virtual float GetOptionalParam( long nParam ){ return 0.0f; };
00422 virtual void SetOptionalParam( long nParam, float val ){};
00423
00424
00439 virtual void ExecuteParamDialog(HWND hWndParent, StdMat2* mtl ){}
00440
00441
00442
00443
00444
00461 virtual BOOL SetDlgThing(EffectParamDlg* dlg) { return FALSE; }
00462 #pragma warning(pop)
00463 };
00464
00465
00466 #define IS_ADAPTIVE 0x1 // adaptive in some way
00467 #define ADAPTIVE_CHECK_BOX 0x2 // enable adaptive check box
00468 #define ADAPTIVE_THRESHOLD 0x4 // enable adaptive threshold spinner
00469 #define SUPER_SAMPLE_TEX_CHECK_BOX 0x8 // enable texture subsampling check box
00470 #define ADVANCED_DLG_BUTTON 0x10 // enable advanced button
00471 #define OPTIONAL_PARAM_0 0x20 // enable optional spinner
00472 #define OPTIONAL_PARAM_1 0x40 // enable optional spinner
00473
00474 #define R3_ADAPTIVE (IS_ADAPTIVE+ADAPTIVE_CHECK_BOX+ADAPTIVE_THRESHOLD)
00475
00476
00477 #define SAMPLERBASE_CHUNK 0x39bf
00478 #define SAMPLERNAME_CHUNK 0x0100
00479 #define SAMPLER_VERS_CHUNK 0x0200
00480
00481
00482