tahoma2d/toonz/sources/stdfx/iwa_spectrumfx.h

77 lines
2.3 KiB
C
Raw Normal View History

2016-05-17 03:04:11 +12:00
#pragma once
2016-03-19 06:57:51 +13:00
/*------------------------------------
Iwa_SpectrumFx
------------------------------------*/
#ifndef IWA_SPECTRUM_H
#define IWA_SPECTRUM_H
#include "tfxparam.h"
#include "stdfx.h"
#include "tfxparam.h"
struct float3 {
2016-06-15 18:43:10 +12:00
float x, y, z;
2016-03-19 06:57:51 +13:00
};
struct float4 {
2016-06-15 18:43:10 +12:00
float x, y, z, w;
2016-03-19 06:57:51 +13:00
};
class Iwa_SpectrumFx final : public TStandardRasterFx {
2016-06-15 18:43:10 +12:00
FX_PLUGIN_DECLARATION(Iwa_SpectrumFx)
2016-03-19 06:57:51 +13:00
protected:
2016-06-15 18:43:10 +12:00
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_lensFactor;
TDoubleParamP m_lightThres;
TDoubleParamP m_lightIntensity;
/*- シャボン色マップの生成 -*/
void calcBubbleMap(float3 *bubbleColor, double frame);
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);
/*- 素材タイルを0〜1に正規化して格納 -*/
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);
/*- 出力結果をChannel値に変換してタイルに格納 -*/
template <typename RASTER, typename PIXEL>
void outputRasters(const RASTER outRas, float4 *in_out_tile_host,
TDimensionI dim);
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
Iwa_SpectrumFx();
2016-03-19 06:57:51 +13:00
2016-06-20 14:23:05 +12:00
void doCompute(TTile &tile, double frame,
const TRenderSettings &settings) override;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
void doCompute_CUDA(TTile &tile, double frame,
const TRenderSettings &settings);
2016-03-19 06:57:51 +13:00
2016-06-20 14:23:05 +12:00
bool doGetBBox(double frame, TRectD &bBox,
const TRenderSettings &info) override;
2016-03-19 06:57:51 +13:00
2016-06-19 20:06:29 +12:00
bool canHandle(const TRenderSettings &info, double frame) override;
2016-03-19 06:57:51 +13:00
};
#endif