mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 16:52:43 +08:00
8b611affa2
* add Font&DebugRender&Profiler * add profiler for metal * fix profiler review problem
59 lines
1.2 KiB
Plaintext
59 lines
1.2 KiB
Plaintext
// Copyright (c) 2017-2020 Xiamen Yaji Software Co., Ltd.
|
|
CCEffect %{
|
|
techniques:
|
|
- passes:
|
|
- vert: debug-renderer-vs:vert
|
|
frag: debug-renderer-fs:frag
|
|
priority: max
|
|
depthStencilState:
|
|
depthTest: false
|
|
depthWrite: false
|
|
blendState:
|
|
targets:
|
|
- blend: true
|
|
blendSrc: src_alpha
|
|
blendDst: one_minus_src_alpha
|
|
blendDstAlpha: one_minus_src_alpha
|
|
rasterizerState:
|
|
cullMode: none
|
|
}%
|
|
|
|
CCProgram debug-renderer-vs %{
|
|
precision mediump float;
|
|
#include <cc-global>
|
|
#include <common>
|
|
|
|
in vec2 a_position;
|
|
in vec2 a_texCoord;
|
|
in vec4 a_color;
|
|
|
|
out vec2 v_texCoord;
|
|
out vec4 v_color;
|
|
|
|
vec4 vert () {
|
|
vec2 position = a_position * cc_screenSize.zw;
|
|
position = position * vec2(2.0, -2.0) + vec2(-1.0, 1.0);
|
|
CC_HANDLE_GET_CLIP_FLIP(position);
|
|
|
|
v_texCoord = a_texCoord;
|
|
v_color = a_color;
|
|
|
|
return vec4(position, 0.0, 1.0);
|
|
}
|
|
}%
|
|
|
|
CCProgram debug-renderer-fs %{
|
|
precision mediump float;
|
|
#include <output>
|
|
|
|
in vec2 v_texCoord;
|
|
in vec4 v_color;
|
|
|
|
uniform sampler2D mainTexture;
|
|
|
|
vec4 frag () {
|
|
vec4 color = vec4(v_color.rgb, v_color.a * texture(mainTexture, v_texCoord).r);
|
|
return CCFragOutput(color);
|
|
}
|
|
}%
|