// 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 #include #include }% CCProgram sky-fs %{ precision highp float; #include #include #include #include }%