mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
5dbb1812f2
* occlusion query * add supportQuery * fix name for occlusion query * remove redundant function Co-authored-by: lijilin <jilin.li@cocos.com>
45 lines
850 B
Plaintext
45 lines
850 B
Plaintext
// Copyright (c) 2017-2020 Xiamen Yaji Software Co., Ltd.
|
|
|
|
CCEffect %{
|
|
techniques:
|
|
- passes:
|
|
- vert: occlusion-query-vs:vert
|
|
frag: occlusion-query-fs:frag
|
|
depthStencilState:
|
|
depthTest: true
|
|
depthWrite: false
|
|
rasterizerState:
|
|
cullMode: back
|
|
blendState:
|
|
targets:
|
|
- blendColorMask: 0
|
|
}%
|
|
|
|
CCProgram occlusion-query-vs %{
|
|
precision highp float;
|
|
#include <cc-global>
|
|
#include <cc-world-bound>
|
|
|
|
layout(location = 0) in vec3 a_position;
|
|
|
|
vec4 vert () {
|
|
vec4 position;
|
|
position = vec4(a_position, 1.0);
|
|
|
|
position *= cc_worldBoundHalfExtents;
|
|
position += cc_worldBoundCenter;
|
|
|
|
position = cc_matViewProj * position;
|
|
|
|
return position;
|
|
}
|
|
}%
|
|
|
|
CCProgram occlusion-query-fs %{
|
|
precision mediump float;
|
|
|
|
vec4 frag () {
|
|
return vec4(1, 0, 0, 1);
|
|
}
|
|
}%
|