Unite def names

This commit is contained in:
Lubos Lenco 2016-02-15 12:48:15 +01:00
parent b95f047c57
commit e2ab26a8f3
5 changed files with 25 additions and 25 deletions

View file

@ -2154,7 +2154,7 @@ class ArmoryExporter(bpy.types.Operator, ExportHelper):
defs.append('_Billboard')
# Whether objects should export tangent data
normal_mapping = '_NormalMapping' in defs
normal_mapping = '_NMTex' in defs
if material.export_tangents != normal_mapping:
material.export_tangents = normal_mapping
# Delete geometry caches
@ -2186,7 +2186,7 @@ class ArmoryExporter(bpy.types.Operator, ExportHelper):
if albedo_input.is_linked:
albedo_node = self.findNodeByLink(tree, node, albedo_input)
if albedo_node.type == 'TEX_IMAGE':
defs.append('_Texturing')
defs.append('_AMTex')
tex = Object()
tex.id = 'salbedo'
tex.name = albedo_node.image.name.rsplit('.', 1)[0] # Remove extension
@ -2230,7 +2230,7 @@ class ArmoryExporter(bpy.types.Operator, ExportHelper):
# Normal Map
normal_input = node.inputs[2]
if normal_input.is_linked:
defs.append('_NormalMapping')
defs.append('_NMTex')
normal_node = self.findNodeByLink(tree, node, normal_input)
tex = Object()
tex.id = 'snormal'

View file

@ -7,18 +7,18 @@ precision mediump float;
#define PI 3.1415926535
#define TwoPI (2.0 * PI)
#ifdef _NormalMapping
#define _Texturing
#ifdef _NMTex
#define _AMTex
#endif
#ifdef _Texturing
#ifdef _AMTex
uniform sampler2D salbedo;
#endif
uniform sampler2D shadowMap;
uniform sampler2D senvmapRadiance;
uniform sampler2D senvmapIrradiance;
uniform sampler2D senvmapBrdf;
#ifdef _NormalMapping
#ifdef _NMTex
uniform sampler2D snormal;
#endif
#ifdef _OMTex
@ -39,14 +39,14 @@ uniform bool lighting;
uniform bool receiveShadow;
in vec3 position;
#ifdef _Texturing
#ifdef _AMTex
in vec2 texCoord;
#endif
in vec4 lPos;
in vec4 matColor;
in vec3 lightDir;
in vec3 eyeDir;
#ifdef _NormalMapping
#ifdef _NMTex
in mat3 TBN;
#else
in vec3 normal;
@ -191,7 +191,7 @@ float getMipLevelFromRoughness(float roughness) {
void main() {
#ifdef _NormalMapping
#ifdef _NMTex
vec3 n = (texture(snormal, texCoord).rgb * 2.0 - 1.0);
n = normalize(TBN * normalize(n));
#else
@ -210,7 +210,7 @@ void main() {
}
}
#ifdef _Texturing
#ifdef _AMTex
vec4 texel = texture(salbedo, texCoord);
#ifdef _AlphaTest
if(texel.a < 0.4)

View file

@ -4,19 +4,19 @@
precision highp float;
#endif
#ifdef _NormalMapping
#define _Texturing
#ifdef _NMTex
#define _AMTex
#endif
in vec3 pos;
in vec3 nor;
#ifdef _Texturing
#ifdef _AMTex
in vec2 tex;
#endif
#ifdef _VCols
in vec4 col;
#endif
#ifdef _NormalMapping
#ifdef _NMTex
in vec3 tan;
#endif
#ifdef _Skinning
@ -40,14 +40,14 @@ uniform float skinBones[50 * 12];
#endif
out vec3 position;
#ifdef _Texturing
#ifdef _AMTex
out vec2 texCoord;
#endif
out vec4 lPos;
out vec4 matColor;
out vec3 lightDir;
out vec3 eyeDir;
#ifdef _NormalMapping
#ifdef _NMTex
out mat3 TBN;
#else
out vec3 normal;
@ -113,7 +113,7 @@ void main() {
gl_Position = P * VM * sPos;
#ifdef _Texturing
#ifdef _AMTex
texCoord = tex;
#endif
@ -133,7 +133,7 @@ void main() {
lightDir = light - mPos;
eyeDir = eye - mPos;
#ifdef _NormalMapping
#ifdef _NMTex
vec3 tangent = (mat3(NM) * (tan));
vec3 bitangent = normalize(cross(_normal, tangent));
TBN = mat3(tangent, bitangent, _normal);

View file

@ -4,8 +4,8 @@
precision mediump float;
#endif
#ifdef _NormalMapping
#define _Texturing
#ifdef _NMTex
#define _AMTex
#endif
in vec4 position;

View file

@ -4,19 +4,19 @@
precision highp float;
#endif
#ifdef _NormalMapping
#define _Texturing
#ifdef _NMTex
#define _AMTex
#endif
in vec3 pos;
#ifdef _Texturing
#ifdef _AMTex
in vec2 tex;
#endif
in vec3 nor;
#ifdef _VCols
in vec4 col;
#endif
#ifdef _NormalMapping
#ifdef _NMTex
in vec3 tan;
in vec3 bitan;
#endif