Skip to content

第十一章中 Billboard 的 Shader 代码是不对的 #337

@luozhaohui

Description

@luozhaohui

第十一章中 BillboardShader 代码是不对的。如果你把 Chapter11-Billboard.shader 代码中的 Cull Off 修改为:Cull Back,就看不到任何 `Billborad 了。其原因在于:方向转换应该在模型空间的左手坐标系中旋转(结果是正面朝向摄像机),而不是在右手坐标系中旋转(结果是背面朝下摄像机)。因此正确的转换代码应该为:

float3 rightDir = normalize(cross(normalDir, upDir));
upDir = normalize(cross(rightDir, normalDir));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions