本文整理汇总了C++中CBlender_Compile类的典型用法代码示例。如果您正苦于以下问题:C++ CBlender_Compile类的具体用法?C++ CBlender_Compile怎么用?C++ CBlender_Compile使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CBlender_Compile类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: atoi
// TODO: DX10: implement CBlender_accum_direct::Compile
void CBlender_accum_direct_volumetric_msaa::Compile(CBlender_Compile& C)
{
IBlender::Compile (C);
if( Name )
::Render->m_MSAASample = atoi( Definition );
else
::Render->m_MSAASample = -1;
// BOOL b_HW_smap = RImplementation.o.HW_smap;
// BOOL b_HW_PCF = RImplementation.o.HW_smap_PCF;
BOOL blend = FALSE; //RImplementation.o.fp16_blend;
D3DBLEND dest = blend?D3DBLEND_ONE:D3DBLEND_ZERO;
if (RImplementation.o.sunfilter) { blend = FALSE; dest = D3DBLEND_ZERO; }
switch (C.iElement)
{
case 0: // near pass - enable Z-test to perform depth-clipping
C.r_Pass ("stub_notransform_2uv","accum_volumetric_sun_msaa", false, TRUE, FALSE,blend,D3DBLEND_ONE,dest);
C.r_dx10Texture ("s_lmap", C.L_textures[0]);
C.r_dx10Texture ("s_smap", r2_RT_smap_depth);
C.r_dx10Texture ("s_noise", "fx\\fx_noise");
C.r_dx10Sampler ("smp_rtlinear");
C.r_dx10Sampler ("smp_linear");
C.r_dx10Sampler ("smp_smap");
C.r_End ();
break;
}
::Render->m_MSAASample = -1;
}
示例2:
void CBlender_deffer_flat::Compile(CBlender_Compile& C)
{
IBlender::Compile (C);
// codepath is the same, only the shaders differ
switch(C.iElement)
{
case SE_R2_NORMAL_HQ: // deffer
uber_deffer (C,true,"base","base",false);
break;
case SE_R2_NORMAL_LQ: // deffer
uber_deffer (C,false,"base","base",false);
break;
case SE_R2_SHADOW: // smap-direct
if (RImplementation.o.HW_smap) C.r_Pass ("shadow_direct_base","dumb", FALSE,TRUE,TRUE,FALSE);
else C.r_Pass ("shadow_direct_base","shadow_direct_base",FALSE);
C.r_Sampler ("s_base",C.L_textures[0]);
C.r_End ();
break;
}
}
示例3:
void CBlender_Particle::Compile (CBlender_Compile& C)
{
IBlender::Compile (C);
switch (oBlend.IDselected)
{
case 0: C.r_Pass ("particle","particle",TRUE, TRUE,TRUE, FALSE, D3DBLEND_ONE, D3DBLEND_ZERO, TRUE,200); break; // SET
case 1: C.r_Pass ("particle","particle",FALSE, TRUE,FALSE, TRUE, D3DBLEND_SRCALPHA, D3DBLEND_INVSRCALPHA, TRUE,0); break; // BLEND
case 2: C.r_Pass ("particle","particle",FALSE, TRUE,FALSE, TRUE, D3DBLEND_ONE, D3DBLEND_ONE, TRUE,0); break; // ADD
case 3: C.r_Pass ("particle","particle",FALSE, TRUE,FALSE, TRUE, D3DBLEND_DESTCOLOR, D3DBLEND_ZERO, TRUE,0); break; // MUL
case 4: C.r_Pass ("particle","particle",FALSE, TRUE,FALSE, TRUE, D3DBLEND_DESTCOLOR, D3DBLEND_SRCCOLOR, TRUE,0); break; // MUL_2X
case 5: C.r_Pass ("particle","particle",FALSE, TRUE,FALSE, TRUE, D3DBLEND_SRCALPHA, D3DBLEND_ONE, TRUE,0); break; // ALPHA-ADD
}
C.r_Sampler ("s_base", C.L_textures[0],false,oClamp.value?D3DTADDRESS_CLAMP:D3DTADDRESS_WRAP);
C.r_End ();
}
示例4:
void CBlender_luminance::Compile(CBlender_Compile& C)
{
IBlender::Compile (C);
switch (C.iElement)
{
case 0: // 256x256 => 64x64
C.r_Pass ("null", "bloom_luminance_1",false,FALSE,FALSE, FALSE);
C.r_Sampler_clf ("s_image", r2_RT_bloom1);
C.r_End ();
break;
case 1: // 64x64 => 8x8
C.r_Pass ("null", "bloom_luminance_2",false,FALSE,FALSE, FALSE);
C.r_Sampler_clf ("s_image", r2_RT_luminance_t64);
C.r_End ();
break;
case 2: // 8x8 => 1x1, blending with old result
C.r_Pass ("null", "bloom_luminance_3",false,FALSE,FALSE, FALSE);
C.r_Sampler_clf ("s_image", r2_RT_luminance_t8 );
C.r_Sampler_clf ("s_tonemap", r2_RT_luminance_src );
C.r_End ();
break;
}
}
示例5:
void CBlender_Model_EbB::Compile(CBlender_Compile& C)
{
IBlender::Compile (C);
if (oBlend.value) {
// forward
LPCSTR vsname = 0;
LPCSTR psname = 0;
switch(C.iElement)
{
case 0:
case 1:
vsname = psname = "model_env_lq";
C.r_Pass (vsname,psname,TRUE,TRUE,FALSE,TRUE,D3DBLEND_SRCALPHA, D3DBLEND_INVSRCALPHA, TRUE,0);
C.r_Sampler ("s_base", C.L_textures[0]);
C.r_Sampler ("s_env", oT2_Name,false,D3DTADDRESS_CLAMP);
C.r_End ();
break;
}
} else {
// deferred
switch(C.iElement)
{
case SE_R2_NORMAL_HQ: // deffer
uber_deffer (C,true, "model","base",false);
break;
case SE_R2_NORMAL_LQ: // deffer
uber_deffer (C,false, "model","base",false);
break;
case SE_R2_SHADOW: // smap
if (RImplementation.o.HW_smap) C.r_Pass ("shadow_direct_model","dumb", FALSE,TRUE,TRUE,FALSE);
else C.r_Pass ("shadow_direct_model","shadow_direct_base", FALSE);
C.r_Sampler ("s_base", C.L_textures[0]);
C.r_End ();
break;
}
}
}
示例6: switch
void CBlender_Vertex::Compile (CBlender_Compile& C)
{
IBlender::Compile (C);
if (C.bEditor)
{
// Editor shader
C.PassBegin ();
{
C.PassSET_ZB (TRUE,TRUE);
C.PassSET_Blend (FALSE,D3DBLEND_ONE,D3DBLEND_ZERO, FALSE,0);
C.PassSET_LightFog (TRUE,TRUE);
// Stage0 - Base texture
C.StageBegin ();
C.StageSET_Color (D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_DIFFUSE);
C.StageSET_Alpha (D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_DIFFUSE);
C.Stage_Texture (oT_Name);
C.Stage_Matrix (oT_xform,0);
C.Stage_Constant ("$null");
C.StageEnd ();
}
C.PassEnd ();
} else {
switch (C.iElement)
{
case SE_R1_NORMAL_HQ:
// Level view
if (C.bDetail_Diffuse)
{
C.r_Pass ("vert_dt","vert_dt",TRUE);
C.r_Sampler ("s_base", C.L_textures[0]);
C.r_Sampler ("s_detail",C.detail_texture);
C.r_End ();
} else {
C.r_Pass ("vert","vert",TRUE);
C.r_Sampler ("s_base",C.L_textures[0]);
C.r_End ();
}
break;
case SE_R1_NORMAL_LQ:
// Level view
C.r_Pass ("vert","vert",TRUE);
C.r_Sampler ("s_base",C.L_textures[0]);
C.r_End ();
break;
case SE_R1_LPOINT:
C.r_Pass ("vert_point","add_point",FALSE,TRUE,FALSE,TRUE,D3DBLEND_ONE,D3DBLEND_ONE,TRUE);
C.r_Sampler ("s_base", C.L_textures[0]);
C.r_Sampler_clf ("s_lmap", TEX_POINT_ATT );
C.r_Sampler_clf ("s_att", TEX_POINT_ATT );
C.r_End ();
break;
case SE_R1_LSPOT:
C.r_Pass ("vert_spot","add_spot",FALSE,TRUE,FALSE,TRUE,D3DBLEND_ONE,D3DBLEND_ONE,TRUE);
C.r_Sampler ("s_base", C.L_textures[0]);
C.r_Sampler_clf ("s_lmap", "internal\\internal_light_att", true);
C.r_Sampler_clf ("s_att", TEX_SPOT_ATT );
C.r_End ();
break;
case SE_R1_LMODELS:
// Lighting only
C.r_Pass ("vert_l","vert_l",FALSE);
C.r_Sampler ("s_base",C.L_textures[0]);
C.r_End ();
break;
}
}
}
示例7: accumulator
void CBlender_accum_direct_mask::Compile(CBlender_Compile& C)
{
IBlender::Compile (C);
switch (C.iElement)
{
case SE_MASK_SPOT: // spot or omni-part
C.r_Pass ("accum_mask", "dumb", false, TRUE,FALSE);
C.r_Sampler_rtf ("s_position", r2_RT_P);
C.r_End ();
break;
case SE_MASK_POINT: // point
C.r_Pass ("accum_mask", "dumb", false, TRUE,FALSE);
C.r_Sampler_rtf ("s_position", r2_RT_P);
C.r_End ();
break;
case SE_MASK_DIRECT: // stencil mask for directional light
C.r_Pass ("null", "accum_sun_mask", false, FALSE,FALSE,TRUE,D3DBLEND_ZERO,D3DBLEND_ONE,TRUE,1);
C.r_Sampler_rtf ("s_normal", r2_RT_N);
C.r_End ();
break;
case SE_MASK_ACCUM_VOL: // copy accumulator (temp -> real), volumetric (usually after blend)
C.r_Pass ("accum_volume", "copy_p", false, FALSE,FALSE);
C.r_Sampler_rtf ("s_base", r2_RT_accum_temp );
C.r_End ();
break;
case SE_MASK_ACCUM_2D: // copy accumulator (temp -> real), 2D (usually after sun-blend)
C.r_Pass ("null", "copy", false, FALSE,FALSE);
C.r_Sampler_rtf ("s_base", r2_RT_accum_temp );
C.r_End ();
break;
case SE_MASK_ALBEDO: // copy accumulator, 2D (for accum->color, albedo_wo)
C.r_Pass ("null", "copy", false, FALSE,FALSE);
C.r_Sampler_rtf ("s_base", r2_RT_accum );
C.r_End ();
break;
}
}
示例8:
void CBlender_accum_spot::Compile(CBlender_Compile& C)
{
IBlender::Compile (C);
BOOL b_HW_smap = RImplementation.o.HW_smap;
BOOL b_HW_PCF = RImplementation.o.HW_smap_PCF;
BOOL blend = RImplementation.o.fp16_blend;
D3DBLEND dest = blend?D3DBLEND_ONE:D3DBLEND_ZERO;
switch (C.iElement)
{
case SE_L_FILL: // masking
C.r_Pass ("null", "copy", false, FALSE, FALSE);
C.r_Sampler ("s_base", C.L_textures[0]);
C.r_End ();
break;
case SE_L_UNSHADOWED: // unshadowed
C.r_Pass ("accum_volume", "accum_spot_unshadowed", false, FALSE,FALSE,blend,D3DBLEND_ONE,dest);
C.r_Sampler_rtf ("s_position", r2_RT_P);
C.r_Sampler_rtf ("s_normal", r2_RT_N);
C.r_Sampler_clw ("s_material", r2_material);
C.r_Sampler ("s_lmap", C.L_textures[0],false,D3DTADDRESS_CLAMP);
C.r_Sampler_rtf ("s_accumulator", r2_RT_accum );
C.r_End ();
break;
case SE_L_NORMAL: // normal
C.r_Pass ("accum_volume", "accum_spot_normal", false, FALSE,FALSE,blend,D3DBLEND_ONE,dest);
C.r_Sampler_rtf ("s_position", r2_RT_P);
C.r_Sampler_rtf ("s_normal", r2_RT_N);
C.r_Sampler_clw ("s_material", r2_material);
C.r_Sampler ("s_lmap", C.L_textures[0],false,D3DTADDRESS_CLAMP);
if (b_HW_smap) {
if (b_HW_PCF) C.r_Sampler_clf ("s_smap",r2_RT_smap_depth );
else C.r_Sampler_rtf ("s_smap",r2_RT_smap_depth );
}
else C.r_Sampler_rtf ("s_smap",r2_RT_smap_surf );
jitter (C);
C.r_Sampler_rtf ("s_accumulator", r2_RT_accum );
C.r_End ();
break;
case SE_L_FULLSIZE: // normal-fullsize
C.r_Pass ("accum_volume", "accum_spot_fullsize", false, FALSE,FALSE,blend,D3DBLEND_ONE,dest);
C.r_Sampler_rtf ("s_position", r2_RT_P);
C.r_Sampler_rtf ("s_normal", r2_RT_N);
C.r_Sampler_clw ("s_material", r2_material);
C.r_Sampler ("s_lmap", C.L_textures[0],false,D3DTADDRESS_CLAMP);
if (b_HW_smap) {
if (b_HW_PCF) C.r_Sampler_clf ("s_smap",r2_RT_smap_depth );
else C.r_Sampler_rtf ("s_smap",r2_RT_smap_depth );
}
else C.r_Sampler_rtf ("s_smap",r2_RT_smap_surf );
jitter (C);
C.r_Sampler_rtf ("s_accumulator", r2_RT_accum );
C.r_End ();
break;
case SE_L_TRANSLUENT: // shadowed + transluency
C.r_Pass ("accum_volume", "accum_spot_fullsize", false, FALSE,FALSE,blend,D3DBLEND_ONE,dest);
C.r_Sampler_rtf ("s_position", r2_RT_P);
C.r_Sampler_rtf ("s_normal", r2_RT_N);
C.r_Sampler_clw ("s_material", r2_material);
C.r_Sampler_clf ("s_lmap", r2_RT_smap_surf); // diff here
if (b_HW_smap) {
if (b_HW_PCF) C.r_Sampler_clf ("s_smap",r2_RT_smap_depth );
else C.r_Sampler_rtf ("s_smap",r2_RT_smap_depth );
}
else C.r_Sampler_rtf ("s_smap",r2_RT_smap_surf );
C.r_Sampler_rtf ("s_accumulator", r2_RT_accum );
jitter (C);
C.r_End ();
break;
}
}
示例9:
adopt_sampler _sampler (LPCSTR _name) { u32 s = C->r_Sampler(_name,0); return adopt_sampler(C,s); }
示例10: if
adopt_sampler& _fmag_point () { if (C) C->i_Filter_Mag(stage,D3DTEXF_POINT); return *this; }