Parcourir la source

Changes for r157 update - Shader changes

master
Palash Bansal il y a 1 an
Parent
révision
8990b2196d
Aucun compte lié à l'adresse e-mail de l'auteur

+ 1
- 1
examples/progressive-hdr-shadows-exp/script.ts Voir le fichier



#if defined( USE_ENVMAP ) && defined( STANDARD ) #if defined( USE_ENVMAP ) && defined( STANDARD )


float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );
float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );


reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness ); reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );



+ 2
- 2
src/plugins/material/ClearcoatTintPlugin.ts Voir le fichier

// Note: clearcoat only considers specular, not diffuse // Note: clearcoat only considers specular, not diffuse


shader.fragmentShader = shaderReplaceString(shader.fragmentShader, shader.fragmentShader = shaderReplaceString(shader.fragmentShader,
'float dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );',
'float dotNVcc = saturate( dot( geometry.clearcoatNormal, -refract(geometry.viewDir, geometry.clearcoatNormal, 1./ccIor) ) );')
'float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );',
'float dotNVcc = saturate( dot( geometryClearcoatNormal, -refract(geometryViewDir, geometryClearcoatNormal, 1./ccIor) ) );')


// todo: we are considering all light is coming from env map, but we should consider light coming from light sources by seperating light and env map attenuation // todo: we are considering all light is coming from env map, but we should consider light coming from light sources by seperating light and env map attenuation
shader.fragmentShader = shaderReplaceString(shader.fragmentShader, shader.fragmentShader = shaderReplaceString(shader.fragmentShader,

+ 1
- 2
src/plugins/material/ParallaxMappingPlugin.ts Voir le fichier

shader.fragmentShader = shaderReplaceString(shader.fragmentShader, shader.fragmentShader = shaderReplaceString(shader.fragmentShader,
// .replace('texture2D( map, parallaxUv.xy )', 'texture2D( map, parallaxUv.xy )') // .replace('texture2D( map, parallaxUv.xy )', 'texture2D( map, parallaxUv.xy )')
'texture2D( map, parallaxUv.xy )', 'texture2D( map, parallaxUv.xy )',
this.debugNormals ? 'vec4(normal, 1.); normal = geometryNormal' : 'vec4(parallaxUv.z,0., 0., 1.)')

this.debugNormals ? 'vec4(normal, 1.); normal = nonPerturbedNormal' : 'vec4(parallaxUv.z,0., 0., 1.)')


shader.fragmentShader = shaderReplaceString(shader.fragmentShader, '#include <normal_fragment_maps>', shader.fragmentShader = shaderReplaceString(shader.fragmentShader, '#include <normal_fragment_maps>',
shaderReplaceString( shaderReplaceString(

+ 1
- 1
src/plugins/material/shaders/ParallaxMappingPlugin.relief.glsl Voir le fichier



// normal = geometryNormal; // normal = geometryNormal;


// todo: modify geometry.position (vViewPosition) for point, spot and area lights
// todo: modify geometryPosition (vViewPosition) for point, spot and area lights


return parallaxUv; return parallaxUv;
} }

+ 1
- 1
src/plugins/pipeline/shaders/SSAOPlugin.patch.glsl Voir le fichier



#if defined( USE_ENVMAP ) #if defined( USE_ENVMAP )


float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );
float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );


reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness ); reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );



Chargement…
Annuler
Enregistrer