| #pragma once |
| |
| |
| |
| |
| |
| |
| #ifndef IWA_SPECTRUM_H |
| #define IWA_SPECTRUM_H |
| |
| #include "stdfx.h" |
| #include "tfxparam.h" |
| |
| struct float3 { |
| float x, y, z; |
| float3 operator*(const float &a) { return {x * a, y * a, z * a}; } |
| float3 operator+(const float3 &a) { return {x + a.x, y + a.y, z + a.z}; } |
| }; |
| struct float4 { |
| float x, y, z, w; |
| }; |
| |
| class Iwa_SpectrumFx : public TStandardRasterFx { |
| FX_PLUGIN_DECLARATION(Iwa_SpectrumFx) |
| |
| protected: |
| TRasterFxPort m_input; |
| TRasterFxPort m_light; |
| |
| TDoubleParamP m_intensity; |
| TDoubleParamP m_refractiveIndex; |
| TDoubleParamP m_thickMax; |
| TDoubleParamP m_thickMin; |
| TDoubleParamP m_RGamma; |
| TDoubleParamP m_GGamma; |
| TDoubleParamP m_BGamma; |
| |
| TDoubleParamP m_loopSpectrumFadeWidth; |
| TDoubleParamP m_spectrumShift; |
| |
| TDoubleParamP m_lensFactor; |
| TDoubleParamP m_lightThres; |
| TDoubleParamP m_lightIntensity; |
| |
| |
| void calcBubbleMap(float3 *bubbleColor, double frame, |
| bool computeAngularAxis = false); |
| |
| template <typename RASTER, typename PIXEL> |
| void convertRaster(const RASTER ras, TDimensionI dim, float3 *bubbleColor); |
| template <typename RASTER, typename PIXEL> |
| void convertRasterWithLight(const RASTER ras, TDimensionI dim, |
| float3 *bubbleColor, const RASTER lightRas, |
| float lightThres, float lightIntensity); |
| |
| |
| template <typename RASTER, typename PIXEL> |
| void setSourceRasters(const RASTER ras, float4 *in_out_tile_host, |
| const RASTER light_ras, float4 *light_host, |
| TDimensionI dim, bool useLight); |
| |
| |
| template <typename RASTER, typename PIXEL> |
| void outputRasters(const RASTER outRas, float4 *in_out_tile_host, |
| TDimensionI dim); |
| |
| public: |
| Iwa_SpectrumFx(); |
| |
| void doCompute(TTile &tile, double frame, |
| const TRenderSettings &settings) override; |
| |
| void doCompute_CUDA(TTile &tile, double frame, |
| const TRenderSettings &settings); |
| |
| bool doGetBBox(double frame, TRectD &bBox, |
| const TRenderSettings &info) override; |
| |
| bool canHandle(const TRenderSettings &info, double frame) override; |
| }; |
| |
| #endif |