You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Little Bits
-=-=-=-=-=- -Fixed small bugs all around -Added ability to show/hide entire sections of the spatial (3D) tree -WIP new vehicle (not ready yet) based on Bullet
This commit is contained in:
@@ -8,6 +8,9 @@
|
||||
precision mediump float;
|
||||
precision mediump int;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
from VisualServer:
|
||||
|
||||
@@ -22,6 +25,26 @@ ARRAY_WEIGHTS=7,
|
||||
ARRAY_INDEX=8,
|
||||
*/
|
||||
|
||||
//hack to use uv if no uv present so it works with lightmap
|
||||
#ifdef ENABLE_AMBIENT_LIGHTMAP
|
||||
|
||||
#ifdef USE_LIGHTMAP_ON_UV2
|
||||
|
||||
#ifndef ENABLE_UV2_INTERP
|
||||
#define ENABLE_UV2_INTERP
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#ifndef ENABLE_UV_INTERP
|
||||
#define ENABLE_UV_INTERP
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* INPUT ATTRIBS */
|
||||
|
||||
attribute highp vec4 vertex_attrib; // attrib:0
|
||||
@@ -238,6 +261,7 @@ void main() {
|
||||
#if defined(ENABLE_TANGENT_INTERP)
|
||||
vec3 tangent_in = tangent_attrib.xyz;
|
||||
tangent_in*=normal_mult;
|
||||
float binormalf = tangent_attrib.a;
|
||||
#endif
|
||||
|
||||
#ifdef USE_SKELETON
|
||||
@@ -272,7 +296,7 @@ void main() {
|
||||
|
||||
#if defined(ENABLE_TANGENT_INTERP)
|
||||
tangent_interp=normalize(tangent_in);
|
||||
binormal_interp = normalize( cross(normal_interp,tangent_interp) * tangent_attrib.a );
|
||||
binormal_interp = normalize( cross(normal_interp,tangent_interp) * binormalf );
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_UV_INTERP)
|
||||
@@ -453,6 +477,27 @@ precision mediump int;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
//hack to use uv if no uv present so it works with lightmap
|
||||
#ifdef ENABLE_AMBIENT_LIGHTMAP
|
||||
|
||||
#ifdef USE_LIGHTMAP_ON_UV2
|
||||
|
||||
#ifndef ENABLE_UV2_INTERP
|
||||
#define ENABLE_UV2_INTERP
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#ifndef ENABLE_UV_INTERP
|
||||
#define ENABLE_UV_INTERP
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* Varyings */
|
||||
|
||||
#if defined(ENABLE_COLOR_INTERP)
|
||||
@@ -545,6 +590,13 @@ uniform int ambient_octree_steps;
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_AMBIENT_LIGHTMAP
|
||||
|
||||
uniform highp sampler2D ambient_lightmap;
|
||||
uniform float ambient_lightmap_multiplier;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
FRAGMENT_SHADER_GLOBALS
|
||||
|
||||
@@ -783,6 +835,34 @@ FRAGMENT_SHADER_CODE
|
||||
}
|
||||
#endif
|
||||
|
||||
float shadow_attenuation = 1.0;
|
||||
|
||||
#ifdef ENABLE_AMBIENT_LIGHTMAP
|
||||
|
||||
vec3 ambientmap_color = vec3(0.0,0.0,0.0);
|
||||
vec2 ambientmap_uv = vec2(0.0,0.0);
|
||||
|
||||
#ifdef USE_LIGHTMAP_ON_UV2
|
||||
|
||||
ambientmap_uv = uv2_interp;
|
||||
|
||||
#else
|
||||
|
||||
ambientmap_uv = uv_interp;
|
||||
|
||||
#endif
|
||||
|
||||
vec4 amcol = texture2D(ambient_lightmap,ambientmap_uv);
|
||||
shadow_attenuation=amcol.a;
|
||||
ambientmap_color = amcol.rgb;
|
||||
ambientmap_color*=ambient_lightmap_multiplier;
|
||||
ambientmap_color*=diffuse.rgb;
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef ENABLE_AMBIENT_OCTREE
|
||||
|
||||
vec3 ambientmap_color = vec3(0.0,0.0,0.0);
|
||||
@@ -828,7 +908,7 @@ FRAGMENT_SHADER_CODE
|
||||
|
||||
#endif
|
||||
|
||||
float shadow_attenuation = 1.0;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1120,7 +1200,7 @@ LIGHT_SHADER_CODE
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef ENABLE_AMBIENT_OCTREE
|
||||
#if defined(ENABLE_AMBIENT_OCTREE) || defined(ENABLE_AMBIENT_LIGHTMAP)
|
||||
|
||||
diffuse.rgb+=ambientmap_color;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user