mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
@@ -3,7 +3,7 @@ bool isnan(float val) {
|
||||
return (val < 0.0 || 0.0 < val || val == 0.0) ? false : true;
|
||||
}
|
||||
bool isinf(float x) {
|
||||
return x == x * 2.0;
|
||||
return x == x * 2.0 && x != 0.0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ vec3 SurfacesFragmentModifyEmissive()
|
||||
#ifndef CC_SURFACES_FRAGMENT_MODIFY_PBRPARAMS
|
||||
vec4 SurfacesFragmentModifyPBRParams()
|
||||
{
|
||||
// ao, roughness, metallic, ao, specularIntensity
|
||||
// ao, roughness, metallic, specularIntensity
|
||||
return vec4(1.0, 0.5, 0.0, 0.5);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -12,11 +12,11 @@ CCEffect %{
|
||||
mainTexture: { value: grey, target: albedoMap, editor: { displayName: BaseColorMap } }
|
||||
baseWeightMap: { value: grey }
|
||||
albedoScale: { value: 1.0, editor: { displayName: BaseWeight } }
|
||||
roughness: { value: 1.0 }
|
||||
roughness: { value: 1.0, editor: { slide: true, range: [0, 1.0], step: 0.001 } }
|
||||
roughnessMap: { value: grey }
|
||||
metallic: { value: 1.0 }
|
||||
metallic: { value: 1.0, editor: { slide: true, range: [0, 1.0], step: 0.001 } }
|
||||
metallicMap: { value: grey }
|
||||
occlusion: { value: 1.0 }
|
||||
occlusion: { value: 1.0, editor: { slide: true, range: [0, 1.0], step: 0.001 } }
|
||||
occlusionMap: { value: white }
|
||||
emissiveScale: { value: 1.0, editor: { displayName: Emissive } }
|
||||
emissiveScaleMap: { value: grey, editor: { displayName: EmissiveMap } }
|
||||
|
||||
@@ -7,25 +7,25 @@ CCEffect %{
|
||||
- vert: standard-vs
|
||||
frag: standard-fs
|
||||
properties: &props
|
||||
mainTexture: { value: grey, target: albedoMap, editor: { displayName: DiffuseMap }}
|
||||
mainColor: { value: [1.0,1.0,1.0,1.0], target: diffuseColor, linear: true, editor: { displayName: DiffuseColor, type: color }}
|
||||
mainTexture: { value: grey, target: albedoMap, editor: { displayName: DiffuseMap } }
|
||||
mainColor: { value: [1.0, 1.0, 1.0, 1.0], target: diffuseColor, linear: true, editor: { displayName: DiffuseColor, type: color } }
|
||||
albedoScale: { value: 1.0, target: diffuseFactor, editor: { displayName: diffuseFactor } }
|
||||
alphaThreshold: { value: 0.5, target: albedoScaleAndCutoff.w, editor: { parent: USE_ALPHA_TEST } }
|
||||
alphaThreshold: { value: 0.5, target: albedoScaleAndCutoff.w, editor: { parent: USE_ALPHA_TEST, slide: true, range: [0, 1.0], step: 0.001 } }
|
||||
emissive: { value: [0.0, 0.0, 0.0, 1.0], linear: true, editor: { type: color } }
|
||||
emissiveMap: { value: grey }
|
||||
shininessExponentMap: { value: grey, editor: { parent: '!HAS_EXPORTED_GLOSSINESS' } }
|
||||
shininessExponent: { value: 100.0, editor: { parent: '!HAS_EXPORTED_GLOSSINESS' } }
|
||||
specularColor: { value: [0.0,0.0,0.0,0.0], linear: true, editor: { displayName: SpecularColor, type: color }}
|
||||
specularColor: { value: [0.0, 0.0, 0.0, 0.0], linear: true, editor: { displayName: SpecularColor, type: color } }
|
||||
specularMap: { value: grey, editor: { parent: '!HAS_EXPORTED_METALLIC' } }
|
||||
specularFactor: { value: 1.0, editor: { parent: '!HAS_EXPORTED_METALLIC' } }
|
||||
transparencyMap: { value: grey, editor: { displayName: TransparencyMap} }
|
||||
transparencyFactor: { value: 0.0 }
|
||||
transparencyMap: { value: grey, editor: { displayName: TransparencyMap } }
|
||||
transparencyFactor: { value: 0.0, editor: { slide: true, range: [0, 1.0], step: 0.001 } }
|
||||
tilingOffset: { value: [1.0, 1.0, 0.0, 0.0] }
|
||||
normalStrength: { value: 1.0, target: normalScale, editor: { displayName: bumpFactor, parent: USE_NORMAL_MAP, slide: true, range: [0, 5.0], step: 0.001 } }
|
||||
normalMap: { value: normal }
|
||||
glossiness: { value: 0.0, editor: { parent: HAS_EXPORTED_GLOSSINESS, slide: true, range: [0, 1.0], step: 0.001 }}
|
||||
metallic: { value: 0.0, editor: { parent: HAS_EXPORTED_METALLIC, slide: true, range: [0, 1.0], step: 0.001 }}
|
||||
metallicMap: { value: grey, editor: {parent: HAS_EXPORTED_METALLIC } }
|
||||
glossiness: { value: 0.0, editor: { parent: HAS_EXPORTED_GLOSSINESS, slide: true, range: [0, 1.0], step: 0.001 } }
|
||||
metallic: { value: 0.0, editor: { parent: HAS_EXPORTED_METALLIC, slide: true, range: [0, 1.0], step: 0.001 } }
|
||||
metallicMap: { value: grey, editor: { parent: HAS_EXPORTED_METALLIC } }
|
||||
- &forward-add
|
||||
vert: standard-vs
|
||||
frag: standard-fs
|
||||
|
||||
@@ -228,7 +228,11 @@ CCProgram surface-fragment %{
|
||||
#define CC_SURFACES_FRAGMENT_MODIFY_TOON_SPECULAR
|
||||
vec4 SurfacesFragmentModifyToonSpecular()
|
||||
{
|
||||
return vec4(1.0, 1.0, 1.0, 0.3);
|
||||
vec4 specularParam = specular;
|
||||
#if USE_SPECULAR_MAP
|
||||
specularParam.rgb *= SRGBToLinear(texture(specularMap, FSInput_texcoord).rgb);
|
||||
#endif
|
||||
return specularParam;
|
||||
}
|
||||
}%
|
||||
|
||||
|
||||
Reference in New Issue
Block a user