Toshihiro Shimizu 890ddd
//------------------------------------------------------------------
Toshihiro Shimizu 890ddd
// Iwa_TiledParticlesFx for Marnie
Toshihiro Shimizu 890ddd
// based on ParticlesFx by Digital Video
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------
Toshihiro Shimizu 890ddd
#ifndef IWA_TILEDPARTICLESFX_H
Toshihiro Shimizu 890ddd
#define IWA_TILEDPARTICLESFX_H
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "stdfx.h"
Toshihiro Shimizu 890ddd
#include "tfxparam.h"
Toshihiro Shimizu 890ddd
#include "tspectrumparam.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//******************************************************************
Toshihiro Shimizu 890ddd
//	Iwa_Particles Fx  class
Toshihiro Shimizu 890ddd
//******************************************************************
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class Iwa_TiledParticlesFx : public TStandardZeraryFx
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	FX_PLUGIN_DECLARATION(Iwa_TiledParticlesFx)
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TFxPortDG m_source, m_control;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TIntParamP source_ctrl_val;
Toshihiro Shimizu 890ddd
	TIntParamP bright_thres_val;
Toshihiro Shimizu 890ddd
	TPointParamP center_val;
Toshihiro Shimizu 890ddd
	TDoubleParamP length_val;
Toshihiro Shimizu 890ddd
	TDoubleParamP height_val;
Toshihiro Shimizu 890ddd
	TDoubleParamP maxnum_val;
Toshihiro Shimizu 890ddd
	TRangeParamP lifetime_val;
Toshihiro Shimizu 890ddd
	TIntParamP lifetime_ctrl_val;
Toshihiro Shimizu 890ddd
	TBoolParamP column_lifetime_val;
Toshihiro Shimizu 890ddd
	TIntParamP startpos_val;
Toshihiro Shimizu 890ddd
	TIntParamP randseed_val;
Toshihiro Shimizu 890ddd
	TDoubleParamP gravity_val;
Toshihiro Shimizu 890ddd
	TDoubleParamP g_angle_val;
Toshihiro Shimizu 890ddd
	TIntParamP gravity_ctrl_val;
Toshihiro Shimizu 890ddd
	TDoubleParamP friction_val;
Toshihiro Shimizu 890ddd
	TIntParamP friction_ctrl_val;
Toshihiro Shimizu 890ddd
	TDoubleParamP windint_val;
Toshihiro Shimizu 890ddd
	TDoubleParamP windangle_val;
Toshihiro Shimizu 890ddd
	TIntEnumParamP swingmode_val;
Toshihiro Shimizu 890ddd
	TRangeParamP randomx_val;
Toshihiro Shimizu 890ddd
	TRangeParamP randomy_val;
Toshihiro Shimizu 890ddd
	TIntParamP randomx_ctrl_val;
Toshihiro Shimizu 890ddd
	TIntParamP randomy_ctrl_val;
Toshihiro Shimizu 890ddd
	TRangeParamP swing_val;
Toshihiro Shimizu 890ddd
	TRangeParamP speed_val;
Toshihiro Shimizu 890ddd
	TIntParamP speed_ctrl_val;
Toshihiro Shimizu 890ddd
	TRangeParamP speeda_val;
Toshihiro Shimizu 890ddd
	TIntParamP speeda_ctrl_val;
Toshihiro Shimizu 890ddd
	TBoolParamP speeda_use_gradient_val;
Toshihiro Shimizu 890ddd
	TBoolParamP speedscale_val;
Toshihiro Shimizu 890ddd
	TIntEnumParamP toplayer_val;
Toshihiro Shimizu 890ddd
	TRangeParamP mass_val;
Toshihiro Shimizu 890ddd
	TRangeParamP scale_val;
Toshihiro Shimizu 890ddd
	TIntParamP scale_ctrl_val;
Toshihiro Shimizu 890ddd
	TBoolParamP scale_ctrl_all_val;
Toshihiro Shimizu 890ddd
	TRangeParamP rot_val;
Toshihiro Shimizu 890ddd
	TIntParamP rot_ctrl_val;
Toshihiro Shimizu 890ddd
	TRangeParamP trail_val;
Toshihiro Shimizu 890ddd
	TDoubleParamP trailstep_val;
Toshihiro Shimizu 890ddd
	TIntEnumParamP rotswingmode_val;
Toshihiro Shimizu 890ddd
	TDoubleParamP rotspeed_val;
Toshihiro Shimizu 890ddd
	TRangeParamP rotsca_val;
Toshihiro Shimizu 890ddd
	TRangeParamP rotswing_val;
Toshihiro Shimizu 890ddd
	TBoolParamP pathaim_val;
Toshihiro Shimizu 890ddd
	TRangeParamP opacity_val;
Toshihiro Shimizu 890ddd
	TIntParamP opacity_ctrl_val;
Toshihiro Shimizu 890ddd
	TRangeParamP trailopacity_val;
Toshihiro Shimizu 890ddd
	TRangeParamP scalestep_val;
Toshihiro Shimizu 890ddd
	TIntParamP scalestep_ctrl_val;
Toshihiro Shimizu 890ddd
	TDoubleParamP fadein_val;
Toshihiro Shimizu 890ddd
	TDoubleParamP fadeout_val;
Toshihiro Shimizu 890ddd
	TIntEnumParamP animation_val;
Toshihiro Shimizu 890ddd
	TIntParamP step_val;
Toshihiro Shimizu 890ddd
	TSpectrumParamP gencol_val;
Toshihiro Shimizu 890ddd
	TIntParamP gencol_ctrl_val;
Toshihiro Shimizu 890ddd
	TDoubleParamP gencol_spread_val;
Toshihiro Shimizu 890ddd
	TDoubleParamP genfadecol_val;
Toshihiro Shimizu 890ddd
	TSpectrumParamP fincol_val;
Toshihiro Shimizu 890ddd
	TIntParamP fincol_ctrl_val;
Toshihiro Shimizu 890ddd
	TDoubleParamP fincol_spread_val;
Toshihiro Shimizu 890ddd
	TDoubleParamP finrangecol_val;
Toshihiro Shimizu 890ddd
	TDoubleParamP finfadecol_val;
Toshihiro Shimizu 890ddd
	TSpectrumParamP foutcol_val;
Toshihiro Shimizu 890ddd
	TIntParamP foutcol_ctrl_val;
Toshihiro Shimizu 890ddd
	TDoubleParamP foutcol_spread_val;
Toshihiro Shimizu 890ddd
	TDoubleParamP foutrangecol_val;
Toshihiro Shimizu 890ddd
	TDoubleParamP foutfadecol_val;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TBoolParamP source_gradation_val;
Toshihiro Shimizu 890ddd
	TBoolParamP pick_color_for_every_frame_val;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	/*-  計算モード (背景+粒子/粒子/背景/照明された粒子)-*/
Toshihiro Shimizu 890ddd
	TIntEnumParamP iw_rendermode_val;
Toshihiro Shimizu 890ddd
	/*- 粒子に貼られる絵の素材 -*/
Toshihiro Shimizu 890ddd
	TIntParamP base_ctrl_val;
Toshihiro Shimizu 890ddd
	/*- カールノイズ的な動きを与える -*/
Toshihiro Shimizu 890ddd
	TDoubleParamP curl_val;
Toshihiro Shimizu 890ddd
	/*- 手前奥でコントロールを2つ持たせ、疑似立体化 -*/
Toshihiro Shimizu 890ddd
	TIntParamP curl_ctrl_1_val;
Toshihiro Shimizu 890ddd
	TIntParamP curl_ctrl_2_val;
Toshihiro Shimizu 890ddd
	/*- 粒子敷き詰め。粒子を正三角形で敷き詰めたときの、
Toshihiro Shimizu 890ddd
		正三角形の一辺の長さをインチで指定する-*/
Toshihiro Shimizu 890ddd
	TDoubleParamP iw_triangleSize;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	/*- ひらひら回転 -*/
Toshihiro Shimizu 890ddd
	TIntParamP flap_ctrl_val;
Toshihiro Shimizu 890ddd
	TDoubleParamP iw_flap_velocity_val;		   /*- 回転角速度 -*/
Toshihiro Shimizu 890ddd
	TDoubleParamP iw_flap_dir_sensitivity_val; /* - 回転軸感度 -*/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	/*- ひらひら粒子に照明を当てる -*/
Toshihiro Shimizu 890ddd
	TDoubleParamP iw_light_theta_val; /*- 光源の方向(Degree) -*/
Toshihiro Shimizu 890ddd
	TDoubleParamP iw_light_phi_val;   /*- 光源の傾き(Degree) -*/
Toshihiro Shimizu 890ddd
	/*- 読み込みマージン -*/
Toshihiro Shimizu 890ddd
	TDoubleParamP margin_val;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	/*- 重力を徐々に与えるためのフレーム長 -*/
Toshihiro Shimizu 890ddd
	TIntParamP iw_gravityBufferFrame_val;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	enum { UNIT_SMALL_INCH,
Toshihiro Shimizu 890ddd
		   UNIT_INCH };
Toshihiro Shimizu 890ddd
	enum { MATTE_REF,
Toshihiro Shimizu 890ddd
		   GRAY_REF,
Toshihiro Shimizu 890ddd
		   H_REF };
Toshihiro Shimizu 890ddd
	enum { SWING_RANDOM,
Toshihiro Shimizu 890ddd
		   SWING_SMOOTH };
Toshihiro Shimizu 890ddd
	enum { ANIM_HOLD,
Toshihiro Shimizu 890ddd
		   ANIM_RANDOM,
Toshihiro Shimizu 890ddd
		   ANIM_CYCLE,
Toshihiro Shimizu 890ddd
		   ANIM_R_CYCLE,
Toshihiro Shimizu 890ddd
		   ANIM_S_CYCLE,
Toshihiro Shimizu 890ddd
		   ANIM_SR_CYCLE };
Toshihiro Shimizu 890ddd
	enum { TOP_YOUNGER,
Toshihiro Shimizu 890ddd
		   TOP_OLDER,
Toshihiro Shimizu 890ddd
		   TOP_SMALLER,
Toshihiro Shimizu 890ddd
		   TOP_BIGGER,
Toshihiro Shimizu 890ddd
		   TOP_RANDOM };
Toshihiro Shimizu 890ddd
	enum { CTRL_NONE = -1,
Toshihiro Shimizu 890ddd
		   CTRL_1,
Toshihiro Shimizu 890ddd
		   CTRL_2 };
Toshihiro Shimizu 890ddd
	/*- 計算モード (背景+粒子/粒子/背景/照明された粒子) -*/
Toshihiro Shimizu 890ddd
	enum { REND_ALL,
Toshihiro Shimizu 890ddd
		   REND_PARTICLES,
Toshihiro Shimizu 890ddd
		   REND_BG,
Toshihiro Shimizu 890ddd
		   REND_ILLUMINATED };
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	Iwa_TiledParticlesFx();
Toshihiro Shimizu 890ddd
	~Iwa_TiledParticlesFx();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool isZerary() const { return true; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int dynamicPortGroupsCount() const { return 2; }
Toshihiro Shimizu 890ddd
	const TFxPortDG *dynamicPortGroup(int g) const
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
		return (g == 0) ? &m_source : (g == 1) ? &m_control : 0;
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool canHandle(const TRenderSettings &info, double frame) { return true; }
Toshihiro Shimizu 890ddd
	bool allowUserCacheOnPort(int port);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 3bfa54
	std::string getAlias(double frame, const TRenderSettings &info) const;
Toshihiro Shimizu 890ddd
	bool doGetBBox(double frame, TRectD &bBox, const TRenderSettings &info);
Toshihiro Shimizu 890ddd
	TFxTimeRegion getTimeRegion() const { return TFxTimeRegion::createUnlimited(); }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void doDryCompute(TRectD &rect, double frame, const TRenderSettings &info);
Toshihiro Shimizu 890ddd
	void doCompute(TTile &tile, double frame, const TRenderSettings &ri);
Toshihiro Shimizu 890ddd
	void compute(TFlash &flash, int frame);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void getParamUIs(TParamUIConcept *&concepts, int &length);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void compatibilityTranslatePort(int majorVersion, int minorVersion, std::string &portName);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif // IWA_TILEDPARTICLESFX_H