当前位置: 首页>>代码示例>>C++>>正文


C++ CBlender_Compile::r_StencilRef方法代码示例

本文整理汇总了C++中CBlender_Compile::r_StencilRef方法的典型用法代码示例。如果您正苦于以下问题:C++ CBlender_Compile::r_StencilRef方法的具体用法?C++ CBlender_Compile::r_StencilRef怎么用?C++ CBlender_Compile::r_StencilRef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CBlender_Compile的用法示例。


在下文中一共展示了CBlender_Compile::r_StencilRef方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Compile

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_dx10Texture		("s_base",	C.L_textures[0]);
            C.r_dx10Texture		("s_env",	oT2_Name);

            C.r_dx10Sampler			("smp_base");
            C.r_dx10Sampler			("smp_rtlinear");
            C.r_End				();
            break;
        }
    } 
    else 
    {
        // deferred
        switch(C.iElement) 
        {
        case SE_R2_NORMAL_HQ: 	// deffer
            uber_deffer		(C,true,	"model","base",false,0,true);
            C.r_Stencil		( TRUE,D3DCMP_ALWAYS,0xff,0x7f,D3DSTENCILOP_KEEP,D3DSTENCILOP_REPLACE,D3DSTENCILOP_KEEP);
            C.r_StencilRef	(0x01);
            C.r_End			();
            break;
        case SE_R2_NORMAL_LQ: 	// deffer
            uber_deffer		(C,false,	"model","base",false,0,true);
            C.r_Stencil		( TRUE,D3DCMP_ALWAYS,0xff,0x7f,D3DSTENCILOP_KEEP,D3DSTENCILOP_REPLACE,D3DSTENCILOP_KEEP);
            C.r_StencilRef	(0x01);
            C.r_End			();
            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_Pass	("shadow_direct_model","dumb",	FALSE,TRUE,TRUE,FALSE);
            //C.r_Sampler		("s_base",C.L_textures[0]);
            C.r_dx10Texture		("s_base",C.L_textures[0]);
            C.r_dx10Sampler		("smp_base");
            C.r_dx10Sampler		("smp_linear");
            C.r_ColorWriteEnable(false, false, false, false);
            C.r_End			();
            break;
        }
    }
}
开发者ID:2asoft,项目名称:xray,代码行数:57,代码来源:Blender_Model_EbB.cpp

示例2:

void	CBlender_Detail_Still::Compile	(CBlender_Compile& C)
{
    IBlender::Compile	(C);

    bool bUseATOC = (RImplementation.o.dx10_msaa_alphatest==CRender::MSAA_ATEST_DX10_0_ATOC);

    switch(C.iElement) 
    {
    case SE_R2_NORMAL_HQ: 		// deffer wave
        if (bUseATOC)
        {
            uber_deffer		(C,false,"detail_w","base_atoc",true,0,true);
            C.r_Stencil		( TRUE,D3DCMP_ALWAYS,0xff,0x7f,D3DSTENCILOP_KEEP,D3DSTENCILOP_REPLACE,D3DSTENCILOP_KEEP);
            C.r_StencilRef	(0x01);
            C.r_ColorWriteEnable(false, false, false, false);
            C.r_CullMode	(D3DCULL_NONE);
            //	Alpha to coverage.
            C.RS.SetRS	(XRDX10RS_ALPHATOCOVERAGE,	TRUE);
            C.r_End			();
        }
        

        uber_deffer		(C,false,"detail_w","base",true, 0, true);
        C.r_Stencil		( TRUE,D3DCMP_ALWAYS,0xff,0x7f,D3DSTENCILOP_KEEP,D3DSTENCILOP_REPLACE,D3DSTENCILOP_KEEP);
        C.r_StencilRef	(0x01);
        C.r_CullMode	(D3DCULL_NONE);
        if (bUseATOC)
            C.RS.SetRS	( D3DRS_ZFUNC, D3DCMP_EQUAL);
        C.r_End			();
        break;
    case SE_R2_NORMAL_LQ: 		// deffer still
        if (bUseATOC)
        {
            uber_deffer		(C,false,"detail_s","base_atoc",true,0,true);
            C.r_Stencil		( TRUE,D3DCMP_ALWAYS,0xff,0x7f,D3DSTENCILOP_KEEP,D3DSTENCILOP_REPLACE,D3DSTENCILOP_KEEP);
            C.r_StencilRef	(0x01);
            C.r_CullMode	(D3DCULL_NONE);
            C.r_ColorWriteEnable(false, false, false, false);
            //	Alpha to coverage.
            C.RS.SetRS	(XRDX10RS_ALPHATOCOVERAGE,	TRUE);
            C.r_End			();
        }

        uber_deffer		(C,false,"detail_s","base",true, 0, true);
        C.r_Stencil		( TRUE,D3DCMP_ALWAYS,0xff,0x7f,D3DSTENCILOP_KEEP,D3DSTENCILOP_REPLACE,D3DSTENCILOP_KEEP);
        C.r_StencilRef	(0x01);
        C.r_CullMode	(D3DCULL_NONE);
        //	Need this for ATOC
        if (bUseATOC)
            C.RS.SetRS	( D3DRS_ZFUNC, D3DCMP_EQUAL);
        C.r_End			();
        break;
    }
}
开发者ID:2asoft,项目名称:xray-16,代码行数:54,代码来源:Blender_detail_still.cpp

示例3:

void	CBlender_combine::Compile(CBlender_Compile& C)
{
    IBlender::Compile		(C);

    switch (C.iElement)
    {
    case 0:	// combine
        C.r_Pass			("combine_1",		"combine_1_nomsaa",		FALSE,	FALSE,	FALSE, TRUE, D3DBLEND_INVSRCALPHA, D3DBLEND_SRCALPHA);	//. MRT-blend?
        C.r_Stencil			(TRUE,D3DCMP_LESSEQUAL,0xff,0x00);	// stencil should be >= 1
        C.r_StencilRef		(0x01);
        //C.r_Sampler_rtf		("s_position",		r2_RT_P				);
        //C.r_Sampler_rtf		("s_normal",		r2_RT_N				);
        //C.r_Sampler_rtf		("s_diffuse",		r2_RT_albedo		);
        //C.r_Sampler_rtf		("s_accumulator",	r2_RT_accum			);
        //C.r_Sampler_rtf		("s_depth",			r2_RT_depth			);
        //C.r_Sampler_rtf		("s_tonemap",		r2_RT_luminance_cur	);
        //C.r_Sampler_clw		("s_material",		r2_material			);
        //C.r_Sampler_clf		("env_s0",			r2_T_envs0			);
        //C.r_Sampler_clf		("env_s1",			r2_T_envs1			);
        //C.r_Sampler_clf		("sky_s0",			r2_T_sky0			);
        //C.r_Sampler_clf		("sky_s1",			r2_T_sky1			);

        C.r_dx10Texture		("s_position",		r2_RT_P				);
        C.r_dx10Texture		("s_normal",		r2_RT_N				);
        C.r_dx10Texture		("s_diffuse",		r2_RT_albedo		);
        C.r_dx10Texture		("s_accumulator",	r2_RT_accum			);
        C.r_dx10Texture		("s_depth",			r2_RT_depth			);
        C.r_dx10Texture		("s_tonemap",		r2_RT_luminance_cur	);
        C.r_dx10Texture		("s_material",		r2_material			);
        C.r_dx10Texture		("env_s0",			r2_T_envs0			);
        C.r_dx10Texture		("env_s1",			r2_T_envs1			);
        C.r_dx10Texture		("sky_s0",			r2_T_sky0			);
        C.r_dx10Texture		("sky_s1",			r2_T_sky1			);
        C.r_dx10Texture		("s_occ",			r2_RT_ssao_temp		);
        C.r_dx10Texture		("s_half_depth",	r2_RT_half_depth	);

        jitter(C);

        C.r_dx10Sampler		("smp_nofilter");
        C.r_dx10Sampler		("smp_material");
        C.r_dx10Sampler		("smp_rtlinear");
        C.r_End				();
        break;
    case 1:	// aa-edge-detection + AA :)
        C.r_Pass			("stub_notransform_aa_AA","combine_2_AA",		FALSE,	FALSE,	FALSE);
        //C.r_Sampler_rtf		("s_position",		r2_RT_P);
        //C.r_Sampler_rtf		("s_normal",		r2_RT_N);
        //C.r_Sampler_clf		("s_image",			r2_RT_generic0);
        //C.r_Sampler_clf		("s_bloom",			r2_RT_bloom1);
        //C.r_Sampler_clf		("s_distort",		r2_RT_generic1);

        C.r_dx10Texture		("s_position",		r2_RT_P);
        C.r_dx10Texture		("s_normal",		r2_RT_N);
        C.r_dx10Texture		("s_image",			r2_RT_generic0);
        C.r_dx10Texture		("s_bloom",			r2_RT_bloom1);
        C.r_dx10Texture		("s_distort",		r2_RT_generic1);

        C.r_dx10Sampler		("smp_nofilter");
        C.r_dx10Sampler		("smp_rtlinear");
        C.r_End				();
        break;
    case 2:	// non-AA
        //	Can use simpler VS (need only Tex0)
        C.r_Pass			("stub_notransform_aa_AA","combine_2_NAA",	FALSE,	FALSE,	FALSE);
        //C.r_Sampler_rtf		("s_position",		r2_RT_P);
        //C.r_Sampler_rtf		("s_normal",		r2_RT_N);
        //C.r_Sampler_clf		("s_image",			r2_RT_generic0);
        //C.r_Sampler_clf		("s_bloom",			r2_RT_bloom1);
        //C.r_Sampler_clf		("s_distort",		r2_RT_generic1);

        C.r_dx10Texture		("s_position",		r2_RT_P);
        C.r_dx10Texture		("s_normal",		r2_RT_N);
        C.r_dx10Texture		("s_image",			r2_RT_generic0);
        C.r_dx10Texture		("s_bloom",			r2_RT_bloom1);
        C.r_dx10Texture		("s_distort",		r2_RT_generic1);

        C.r_dx10Sampler		("smp_nofilter");
        C.r_dx10Sampler		("smp_rtlinear");
        C.r_End				();
        break;
    case 3:	// aa-edge-detection + AA :) + DISTORTION
        C.r_Pass			("stub_notransform_aa_AA","combine_2_AA_D",	FALSE,	FALSE,	FALSE);
        //C.r_Sampler_rtf		("s_position",		r2_RT_P);
        //C.r_Sampler_rtf		("s_normal",		r2_RT_N);
        //C.r_Sampler_clf		("s_image",			r2_RT_generic0);
        //C.r_Sampler_clf		("s_bloom",			r2_RT_bloom1);
        //C.r_Sampler_clf		("s_distort",		r2_RT_generic1);

        C.r_dx10Texture		("s_position",		r2_RT_P);
        C.r_dx10Texture		("s_normal",		r2_RT_N);
        C.r_dx10Texture		("s_image",			r2_RT_generic0);
        C.r_dx10Texture		("s_bloom",			r2_RT_bloom1);
        C.r_dx10Texture		("s_distort",		r2_RT_generic1);

        C.r_dx10Sampler		("smp_nofilter");
        C.r_dx10Sampler		("smp_rtlinear");
        C.r_End				();
        break;
    case 4:	// non-AA + DISTORTION
        //	Can use simpler VS (need only Tex0)
//.........这里部分代码省略.........
开发者ID:2asoft,项目名称:xray-16,代码行数:101,代码来源:blender_combine.cpp

示例4:

void	CBlender_deffer_model::Compile(CBlender_Compile& C)
{
    IBlender::Compile		(C);

    BOOL	bForward		= FALSE;
    if (oBlend.value && oAREF.value<16)	bForward	= TRUE;
    if (oStrictSorting.value)			bForward	= TRUE;

    if (bForward)			{
        // forward rendering
        LPCSTR	vsname,psname;
        switch(C.iElement) 
        {
        case 0: 	//
        case 1: 	//
            vsname = psname =	"model_def_lq"; 
            C.r_Pass			(vsname,psname,TRUE,TRUE,FALSE,TRUE,D3DBLEND_SRCALPHA,	D3DBLEND_INVSRCALPHA,	TRUE,oAREF.value);
            //C.r_Sampler			("s_base",	C.L_textures[0]);
            C.r_dx10Texture		("s_base",	C.L_textures[0]);
            C.r_dx10Sampler		("smp_base");
            C.r_End				();
            break;
        default:
            break;
        }
    } else {
        BOOL	bAref		= oBlend.value;
        // deferred rendering
        // codepath is the same, only the shaders differ

        bool bUseATOC = (bAref && (RImplementation.o.dx10_msaa_alphatest==CRender::MSAA_ATEST_DX10_0_ATOC));

        C.TessMethod = oTessellation.IDselected;
        switch(C.iElement) 
        {
        case SE_R2_NORMAL_HQ: 			// deffer
            if (bUseATOC)
            {
                uber_deffer		(C,true,"model","base_atoc",bAref,0,true);
                C.r_Stencil		( TRUE,D3DCMP_ALWAYS,0xff,0x7f,D3DSTENCILOP_KEEP,D3DSTENCILOP_REPLACE,D3DSTENCILOP_KEEP);
                C.r_StencilRef	(0x01);
                C.r_ColorWriteEnable(false, false, false, false);
                //	Alpha to coverage.
                C.RS.SetRS	(XRDX10RS_ALPHATOCOVERAGE,	TRUE);
                C.r_End			();
            }

            uber_deffer		(C,true,	"model",	"base",bAref,0,true);

            C.r_Stencil		( TRUE,D3DCMP_ALWAYS,0xff,0x7f,D3DSTENCILOP_KEEP,D3DSTENCILOP_REPLACE,D3DSTENCILOP_KEEP);
            C.r_StencilRef	(0x01);
            if (bUseATOC) C.RS.SetRS	( D3DRS_ZFUNC, D3DCMP_EQUAL);
            C.r_End			();
            break;
        case SE_R2_NORMAL_LQ: 			// deffer
            if (bUseATOC)
            {
                uber_deffer		(C,false,"model","base_atoc",bAref,0,true);
                C.r_Stencil		( TRUE,D3DCMP_ALWAYS,0xff,0x7f,D3DSTENCILOP_KEEP,D3DSTENCILOP_REPLACE,D3DSTENCILOP_KEEP);
                C.r_StencilRef	(0x01);
                C.r_ColorWriteEnable(false, false, false, false);
                //	Alpha to coverage.
                C.RS.SetRS	(XRDX10RS_ALPHATOCOVERAGE,	TRUE);
                C.r_End			();
            }

            uber_deffer		(C,false,	"model",	"base",bAref,0,true);
            C.r_Stencil		( TRUE,D3DCMP_ALWAYS,0xff,0x7f,D3DSTENCILOP_KEEP,D3DSTENCILOP_REPLACE,D3DSTENCILOP_KEEP);
            C.r_StencilRef	(0x01);
            if (bUseATOC) C.RS.SetRS	( D3DRS_ZFUNC, D3DCMP_EQUAL);
            C.r_End			();
            break;
        case SE_R2_SHADOW:				// smap
            if (bAref)
            {
                //if (RImplementation.o.HW_smap)	C.r_Pass	("shadow_direct_model_aref","shadow_direct_base_aref",	FALSE,TRUE,TRUE,FALSE,D3DBLEND_ZERO,D3DBLEND_ONE,TRUE,220);
                //else							C.r_Pass	("shadow_direct_model_aref","shadow_direct_base_aref",	FALSE);
                //C.r_Sampler		("s_base",C.L_textures[0]);
                C.r_Pass	("shadow_direct_model_aref","shadow_direct_base_aref",	FALSE,TRUE,TRUE,FALSE,D3DBLEND_ZERO,D3DBLEND_ONE,TRUE,220);
                C.r_dx10Texture		("s_base",C.L_textures[0]);
                C.r_dx10Sampler		("smp_base");
                C.r_dx10Sampler		("smp_linear");
                C.r_ColorWriteEnable(false, false, false, false);
                C.r_End			();
                break;
            } 
            else 
            {
                //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_Pass	("shadow_direct_model","dumb",	FALSE,TRUE,TRUE,FALSE);
                //C.r_Sampler		("s_base",C.L_textures[0]);
                C.r_dx10Texture		("s_base",C.L_textures[0]);
                C.r_dx10Sampler		("smp_base");
                C.r_dx10Sampler		("smp_linear");
                C.r_ColorWriteEnable(false, false, false, false);
                C.r_End			();
                break;
            }
        }
//.........这里部分代码省略.........
开发者ID:2asoft,项目名称:xray-16,代码行数:101,代码来源:blender_deffer_model.cpp


注:本文中的CBlender_Compile::r_StencilRef方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。