Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opaque和transparent下blending都为alphaBlending的疑问 #41

Open
yj7810520113 opened this issue Apr 18, 2022 · 0 comments
Open

opaque和transparent下blending都为alphaBlending的疑问 #41

yj7810520113 opened this issue Apr 18, 2022 · 0 comments

Comments

@yj7810520113
Copy link

renderEntity中,无论对于opaque还是transparent pass,blending均为 alphaBlending,这个blending默认值是有什么目的吗?

function getOpaqueRenderState() {
    return Cesium.RenderState.fromCache({
        cull : {
            enabled : false
        },
        depthTest : {
            enabled : true,
            func : Cesium.DepthFunction.LESS_OR_EQUAL
        },
        blending : Cesium.BlendingState.ALPHA_BLEND
    });
}

function getTransparentRenderState() {
    return Cesium.RenderState.fromCache({
        cull : {
            enabled : true
        },
        depthTest : {
            enabled : true,
            func : Cesium.DepthFunction.LESS_OR_EQUAL
        },
        blending : Cesium.BlendingState.ALPHA_BLEND
    });
}

对比3DTiles中

function getTranslucentRenderState(renderState) {
  var rs = clone(renderState, true);
  rs.cull.enabled = false;
  rs.depthTest.enabled = true;
  rs.depthMask = false;
  rs.blending = BlendingState.ALPHA_BLEND;
  rs.stencilTest = StencilConstants.setCesium3DTileBit();
  rs.stencilMask = StencilConstants.CESIUM_3D_TILE_MASK;

  return RenderState.fromCache(rs);
}

function getOpaqueRenderState(renderState) {
  var rs = clone(renderState, true);
  rs.stencilTest = StencilConstants.setCesium3DTileBit();
  rs.stencilMask = StencilConstants.CESIUM_3D_TILE_MASK;

  return RenderState.fromCache(rs);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant