15.试验模型边缘高亮

为什么只能看到绿色的呢?

Vertex_program没起作用?

注释掉vs还不行。

找到原因了,原来是被绿色盖住了。

void edgeHighLight_vp(float4 position : POSITION,

float3 normal : NORMAL,

out float4 oPosition : POSITION,

uniform float4x4 worldViewProj)

{

//oPosition = float4(position.xyz + normal * 0.6f, 1);

oPosition = float4(position.x + 70.0f, position.yzw);

oPosition = mul(worldViewProj, oPosition);

}

改了后就能看到两个pass都绘制了。

每天花30分钟看OGRE--(14)试验模型边缘高亮

并不是没有法线,noramls true

每天花30分钟看OGRE--(14)试验模型边缘高亮

改成cull_hardware anticlockwise就正常了。这个就是原因了!

每天花30分钟看OGRE--(14)试验模型边缘高亮

 放在Example.meterial里

vertex_program Examples/EdgeHighLightVS hlsl
{
    source EdgeHighLightVS.hlsl
    entry_point edgeHighLight_vp
    target vs_1_1
    
    default_params
    {
        param_named_auto worldViewProj worldviewproj_matrix
    }
}

fragment_program Examples
/EdgeHighLightPS hlsl
{
    source EdgeHighLightPS.hlsl
    entry_point edgeHighLight_fp
    target ps_2_0
    
    default_params
    {
    }
}

material Examples
/EnvMappedRustySteelEdgeHighLight
{
    technique
    {    
        pass
        {
            cull_hardware anticlockwise
            
            vertex_program_ref Examples
/EdgeHighLightVS
            {
            }
            
            fragment_program_ref Examples
/EdgeHighLightPS
            {
            }
        }
        
        pass
        {
            cull_hardware none
            
//polygon_mode wireframe
            
            texture_unit
            {
                texture RustySteel.jpg
            }

            texture_unit
            {
                texture spheremap.png
                colour_op_ex add src_texture src_current
                colour_op_multipass_fallback one one
                env_map spherical
            }
        }
    }
}

相关文章:

  • 2021-07-22
  • 2021-08-15
  • 2022-12-23
  • 2021-08-05
  • 2021-08-15
  • 2021-11-21
  • 2021-11-22
猜你喜欢
  • 2021-05-24
  • 2021-07-31
  • 2021-08-13
  • 2021-08-29
  • 2021-08-10
相关资源
相似解决方案