| #pragma once |
| |
| |
| |
| |
| |
| #ifndef IWA_PN_PERSPECTIVE_H |
| #define IWA_PN_PERSPECTIVE_H |
| |
| #include "tfxparam.h" |
| #include "stdfx.h" |
| #include "tparamset.h" |
| |
| struct float2 { |
| float x, y; |
| }; |
| struct float3 { |
| float x, y, z; |
| }; |
| struct float4 { |
| float x, y, z, w; |
| }; |
| |
| |
| struct PN_Params { |
| int renderMode; |
| int noiseType; |
| float size; |
| int octaves; |
| float2 offset; |
| float p_intensity; |
| float p_size; |
| float p_offset; |
| float2 eyeLevel; |
| int drawLevel; |
| bool alp_rend_sw; |
| float waveHeight; |
| float fy_2; |
| float A; |
| float3 cam_pos; |
| float base_fresnel_ref; |
| float int_sum; |
| float a11, a12, a13; |
| float a21, a22, a23; |
| float time; |
| float p_evolution; |
| }; |
| |
| class Iwa_PNPerspectiveFx final : public TStandardZeraryFx { |
| FX_PLUGIN_DECLARATION(Iwa_PNPerspectiveFx) |
| |
| TIntEnumParamP |
| m_renderMode; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| TIntEnumParamP |
| m_noiseType; |
| |
| |
| |
| |
| |
| TDoubleParamP m_size; |
| TDoubleParamP m_evolution; |
| TIntEnumParamP m_octaves; |
| TPointParamP m_offset; |
| |
| TDoubleParamP m_persistance_intensity; |
| TDoubleParamP m_persistance_size; |
| TDoubleParamP m_persistance_evolution; |
| TDoubleParamP m_persistance_offset; |
| |
| TDoubleParamP m_fov; |
| TPointParamP m_eyeLevel; |
| |
| TBoolParamP |
| m_alpha_rendering; |
| |
| TDoubleParamP m_waveHeight; |
| |
| |
| template <typename RASTER, typename PIXEL> |
| void setOutputRaster(float4 *srcMem, const RASTER dstRas, TDimensionI dim, |
| int drawLevel, const bool alp_rend_sw); |
| |
| |
| void getPNParameters(TTile &tile, double frame, |
| const TRenderSettings &settings, PN_Params ¶ms, |
| TDimensionI &dimOut); |
| |
| |
| void calcPerinNoise_CPU(float4 *out_host, TDimensionI &dimOut, PN_Params &p, |
| bool doResample); |
| |
| |
| void calcPNNormal_CPU(float4 *out_host, TDimensionI &dimOut, PN_Params &p, |
| bool isSubWave = false); |
| |
| public: |
| Iwa_PNPerspectiveFx(); |
| |
| bool doGetBBox(double frame, TRectD &bBox, |
| const TRenderSettings &info) override; |
| |
| bool canHandle(const TRenderSettings &info, double frame) override; |
| |
| void doCompute(TTile &tile, double frame, |
| const TRenderSettings &rend_sets) override; |
| |
| void doCompute_CPU(TTile &tile, double frame, const TRenderSettings &settings, |
| float4 *out_host, TDimensionI &dimOut, |
| PN_Params &pnParams); |
| |
| void getParamUIs(TParamUIConcept *&concepts, int &length) override; |
| }; |
| |
| #endif |