update polyvox shader to track changes in packDeferredFragment

This commit is contained in:
Seth Alves 2016-01-05 16:06:59 -08:00
parent c2f2f950fb
commit 1e69f695b4

View file

@ -28,6 +28,9 @@ void main(void) {
vec3 worldNormal = cross(dFdy(_worldPosition.xyz), dFdx(_worldPosition.xyz));
worldNormal = normalize(worldNormal);
vec3 specular = DEFAULT_SPECULAR;
float shininess = DEFAULT_SHININESS;
float inPositionX = (_worldPosition.x - 0.5) / voxelVolumeSize.x;
float inPositionY = (_worldPosition.y - 0.5) / voxelVolumeSize.y;
float inPositionZ = (_worldPosition.z - 0.5) / voxelVolumeSize.z;
@ -41,5 +44,5 @@ void main(void) {
vec3 yzDiffuseScaled = yzDiffuse.rgb * abs(worldNormal.x);
vec4 diffuse = vec4(xyDiffuseScaled + xzDiffuseScaled + yzDiffuseScaled, 1.0);
packDeferredFragment(_normal, 0.0, vec3(diffuse), vec3(0.01, 0.01, 0.01), 10.0);
packDeferredFragment(_normal, 1.0, vec3(diffuse), specular, shininess);
}