mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
c4c95e9e59
* add sky.effect with surface shader surface shader code style * get ready for chunks reorganizing * Delete default_skybox_diffusion.png.meta * add depth functions * add meta
53 lines
1.2 KiB
Plaintext
53 lines
1.2 KiB
Plaintext
// Copyright (c) 2017-2022 Xiamen Yaji Software Co., Ltd.
|
|
|
|
CCEffect %{
|
|
techniques:
|
|
- name: opaque
|
|
passes:
|
|
- vert: sky-vs
|
|
frag: sky-fs
|
|
priority : max - 10
|
|
rasterizerState :
|
|
cullMode : none
|
|
depthStencilState :
|
|
depthTest: true
|
|
depthWrite : false
|
|
}%
|
|
|
|
|
|
CCProgram surface-fragment %{
|
|
#define CC_SURFACES_FRAGMENT_MODIFY_BASECOLOR_AND_TRANSPARENCY
|
|
vec4 SurfacesFragmentModifyBaseColorAndTransparency()
|
|
{
|
|
vec3 c = cc_ambientSky.xyz;
|
|
#if CC_USE_IBL
|
|
vec3 normal = normalize(FSInput_worldNormal);
|
|
#if USE_RGBE_CUBEMAP
|
|
c *= unpackRGBE(texture(cc_environment, normal.xyz));
|
|
#else
|
|
c *= SRGBToLinear(texture(cc_environment, normal.xyz).rgb);
|
|
#endif
|
|
#endif
|
|
return vec4(c * cc_ambientSky.w, 1.0);
|
|
}
|
|
}%
|
|
|
|
CCProgram sky-vs %{
|
|
precision highp float;
|
|
|
|
#include <surfaces/effect-macros/sky>
|
|
#include <surfaces/includes/common-vs>
|
|
#include <shading-entries/main-functions/misc/sky-vs>
|
|
}%
|
|
|
|
|
|
CCProgram sky-fs %{
|
|
precision highp float;
|
|
#include <surfaces/effect-macros/sky>
|
|
#include <surfaces/includes/common-fs>
|
|
|
|
#include <surface-fragment>
|
|
|
|
#include <shading-entries/main-functions/misc/sky-fs>
|
|
}%
|