Commit 80813006 authored by Georg Schaefer's avatar Georg Schaefer
Browse files

add better normal map

parent 0dba15df
......@@ -25,20 +25,20 @@ vec3 blinn_phong(vec3 N, vec3 L, vec3 V, vec3 light_color, vec3 diff_color, floa
}
void main() {
float depth = 2.0 * texture(depth_texture, gl_FragCoord.xy / resolution).x - 1.0;
vec3 clip_space;
clip_space.xy = 2.0 * gl_FragCoord.xy / resolution - 1.0;
clip_space.z = depth;
vec4 world_space = inv_view_projection * vec4(clip_space,1.0);
vec3 p = world_space.xyz / world_space.w;
vec3 N = normalize(texture(normal_texture, gl_FragCoord.xy / resolution).xyz);
vec3 V = normalize(view_vector - p);
vec3 diffuse_color = texture(albedo_texture, gl_FragCoord.xy / resolution).rgb;
float specular_exponent = texture(specular_texture, gl_FragCoord.xy / resolution).r * 128;
float emission = texture(specular_texture, gl_FragCoord.xy / resolution).g;
vec3 L = point_light_position - p;
float depth = 2.0 * texture(depth_texture, gl_FragCoord.xy / resolution).x - 1.0;
vec3 clip_space;
clip_space.xy = 2.0 * gl_FragCoord.xy / resolution - 1.0;
clip_space.z = depth;
vec4 world_space = inv_view_projection * vec4(clip_space,1.0);
vec3 p = world_space.xyz / world_space.w;
vec3 N = normalize(texture(normal_texture, gl_FragCoord.xy / resolution).xyz);
vec3 V = normalize(view_vector - p);
vec3 diffuse_color = texture(albedo_texture, gl_FragCoord.xy / resolution).rgb;
float specular_exponent = texture(specular_texture, gl_FragCoord.xy / resolution).r * 128;
float emission = texture(specular_texture, gl_FragCoord.xy / resolution).g;
vec3 L = point_light_position - p;
float d = length(L);
float r = point_light_radius;
......
No preview for this file type
planet_normal.dds : 24
dome_diffuse.dds : 17
piratenschiff_material.dds : 4
Meteor_LOW_Normals.dds : 10
cannon.dds : 11
victim_diffuse.dds : 15
deathstar_material.dds : 23
coin.dds : 22
next_id : 25
planet_textur.dds : 19
victim2_diffuse.dds : 16
black.dds.001.dds : 8
greyscale_normal.dds.001.dds : 14
deathstar.dds : 20
dome_material.dds : 18
beam_stripes.dds : 13
weighted_companion_cube_export_material.dds : 3
piratenschiff_diffuse.dds : 5
Meteor_normal_2.dds : 21
piratenschiff_normal.dds : 6
beam.dds : 12
greyscale_normal.dds : 2
black.dds : 7
beam_stripes.dds : 13
weighted_companion_cube_export_material.dds : 3
deathstar.dds : 20
dome_material.dds : 18
greyscale_normal.dds.001.dds : 14
black.dds.001.dds : 8
planet_textur.dds : 19
victim2_diffuse.dds : 16
weighted_companion_cube_export.dds : 1
piratenschiff_normal.dds : 6
cannon.dds : 11
victim_diffuse.dds : 15
Texture_Meteor.dds : 9
next_id : 25
coin.dds : 22
deathstar_material.dds : 23
weighted_companion_cube_export.dds : 1
Meteor_LOW_Normals.dds : 10
piratenschiff_material.dds : 4
planet_normal.dds : 24
dome_diffuse.dds : 17
black.dds : 7
greyscale_normal.dds : 2
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment