Normalize

This commit is contained in:
luboslenco 2018-03-26 02:16:43 +02:00
parent addbdc5ce3
commit d6dddc4d57
3 changed files with 4 additions and 4 deletions

View file

@ -120,7 +120,7 @@ float traceShadow(sampler3D voxels, const vec3 origin, const vec3 dir, const flo
}
vec3 traceSpecular(sampler3D voxels, const vec3 pos, const vec3 normal, const vec3 viewDir, const float roughness) {
float rough = max(roughness, 0.15);
float rough = max(roughness, 0.02);
float specularAperture = clamp(tan((3.14159265 / 2) * rough * 0.75), 0.0174533, 3.14159265);
vec3 specularDir = normalize(reflect(-viewDir, normal));
return traceCone(voxels, pos, specularDir, specularAperture, MAX_DISTANCE, normal).xyz;

View file

@ -35,9 +35,9 @@ void main() {
vec3 wposition = ((gl_GlobalInvocationID.xyz - hres) / hres) * voxelgiHalfExtents;
uint unor = imageLoad(voxelsNor, ivec3(gl_GlobalInvocationID.xyz)).r;
vec3 wnormal = decNor(unor); // todo: normalize here
vec3 wnormal = normalize(decNor(unor));
wposition -= normalize(wnormal) * 0.01; // Offset
wposition -= wnormal * 0.01; // Offset
float visibility;
vec3 lp = lightPos - wposition;

View file

@ -573,7 +573,7 @@ class ArmRPListItem(bpy.types.PropertyGroup):
arm_volumetric_light_steps = IntProperty(name="Steps", default=20, min=0, update=assets.invalidate_shader_cache)
arm_shadowmap_split = FloatProperty(name="Cascade Split", description="Split factor for cascaded shadow maps, higher factor favors detail on close surfaces", default=0.8, update=assets.invalidate_shader_cache)
arm_autoexposure_strength = FloatProperty(name="Auto Exposure Strength", default=0.7, update=assets.invalidate_shader_cache)
arm_ssrs_ray_step = FloatProperty(name="Ray Step", default=0.01, update=assets.invalidate_shader_cache)
arm_ssrs_ray_step = FloatProperty(name="Step", default=0.01, update=assets.invalidate_shader_cache)
# Compositor
arm_letterbox = BoolProperty(name="Letterbox", default=False, update=assets.invalidate_shader_cache)
arm_letterbox_size = FloatProperty(name="Size", default=0.1, update=assets.invalidate_shader_cache)