Normal, height and material maps generating

This commit is contained in:
ilshat.safiullin committed 2018-06-08 15:45:34 +05:00
1 parent efdd4fdee4
commit 6e1ef6d668
15 files changed
+33548 -89

No files matched your search

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 263 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 757 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

+33234
View File
File diff suppressed because it is too large. Load diff
+11
View File
@@ -0,0 +1,11 @@
{
"lines": [
{"start": [-500, -500], "end": [500, 500], "color": [0.25, 0, 0.4]},
{"start": [-500, 500], "end": [500, -500], "color": [0.1, 0.7, 0.4]},
{"start": [-400, -400], "end": [400, -400], "color": [0.3, 0.3, 0.0]},
{"start": [400, -400], "end": [400, 400], "color": [0.0, 0.3, 0.15]},
{"start": [400, 400], "end": [-400, 400], "color": [0.2, 0.6, 0.9]},
{"start": [-400, 400], "end": [-400, -400], "color": [0.5, 0.3, 0.1]}
]
}
+3 -2
View File
@@ -2,6 +2,7 @@ precision mediump float;
uniform sampler2D Texture;
uniform sampler2D NormalMap;
uniform sampler2D HeightMap;
uniform sampler2D TransparencyMask;
precision highp float;
@@ -12,7 +13,7 @@ varying vec3 ts_frag_pos;
const float num_layers = 16.0;
const float depth_scale = 0.01;
const float depth_scale = 0.002;
@@ -63,6 +64,6 @@ void main(void)
// Normal mapping
vec3 norm = normalize(texture2D(NormalMap, uv).rgb * 2.0 - 1.0);
float diffuse = max(dot(light_dir, norm), 0.0);
gl_FragColor = vec4(diffuse * albedo + ambient, 1.0);
gl_FragColor = vec4(diffuse * albedo + ambient, texture2D(TransparencyMask, uv).a);
}
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 466 KiB

+10
View File
@@ -0,0 +1,10 @@
precision mediump float;
uniform sampler2D Texture;
uniform sampler2D TransparencyMask;
varying vec2 texCoord;
void main() {
vec4 color = texture2D(Texture,texCoord).rgba;
gl_FragColor = vec4(color.rgb, texture2D(TransparencyMask, texCoord).a);
}
+11
View File
@@ -0,0 +1,11 @@
attribute vec3 vPosition;
attribute vec2 vTexCoord;
varying vec2 texCoord;
uniform mat4 ProjectionMatrix;
void main() {
gl_Position = ProjectionMatrix * vec4(vPosition.xyz, 1.0);
texCoord = vTexCoord;
}
+11
View File
@@ -0,0 +1,11 @@
precision mediump float;
uniform sampler2D Texture;
uniform sampler2D TransparencyMask;
varying vec2 texCoord;
varying vec3 fragColor;
void main() {
vec3 color = normalize(texture2D(Texture,texCoord).rgb + fragColor);
gl_FragColor = vec4(color, texture2D(TransparencyMask, texCoord).a);
}
+14
View File
@@ -0,0 +1,14 @@
attribute vec3 vPosition;
attribute vec3 vColor;
attribute vec2 vTexCoord;
varying vec2 texCoord;
varying vec3 fragColor;
uniform mat4 ProjectionMatrix;
void main() {
gl_Position = ProjectionMatrix * vec4(vPosition.xyz, 1.0);
texCoord = vTexCoord;
fragColor = vColor;
}