mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
Shadow optimization (#7459)
* toon receives shadow * fix gfx state cache * 背面消影 * merge cc_ShadowPCF && cc_ShadowMapSize to cc_ShadowInfo; add bias to shader and editor * update * merge pr #7452 https://github.com/cocos-creator/engine/pull/7452 * reomve atten; use NL Co-authored-by: Yun Hsiao Wu <inheritorofgalaxy@gmail.com>
This commit is contained in:
committed by
GitHub
parent
21a6bb135a
commit
3375a5cf15
@@ -15,16 +15,7 @@
|
||||
#define FP_SCALE 0.0009765625
|
||||
#define FP_SCALE_INV 1024.0
|
||||
|
||||
// Suppose `vi` as an unsigned byte pixel channel value,
|
||||
// when sample this value from texture and multiple it with `255.0` to yield floating value `v`,
|
||||
// this macro function is equaivalent to `float((vi) > 128 ? 1 : 0)`.
|
||||
// Use this macro function to avoid precision issue caused by `step(128.0, v)`.
|
||||
#define STEP_FINT_128(v) (step(128.0, (v) + 0.5))
|
||||
|
||||
// Suppose `vi` as an unsigned byte pixel channel value,
|
||||
// when sample this value from texture and multiple it with `255.0` to yield floating value `v`,
|
||||
// this macro functdion is equaivalent to `float((vi) % 128)`.
|
||||
// Use this macro function to avoid precision issue caused by `mod(v, 128.0)`.
|
||||
#define MOD_FINT_128(v) (mod(float(int((v) + 0.5)), 128.0))
|
||||
|
||||
highp float decode32 (highp vec4 rgba) {
|
||||
|
||||
Reference in New Issue
Block a user