Merge branch 'master' of D:\Git_New\fgdata
This commit is contained in:
commit
ceba9bc96b
20 changed files with 196 additions and 98 deletions
58
Aircraft/Instruments-3d/garmin196/garmin196.ac
Normal file → Executable file
58
Aircraft/Instruments-3d/garmin196/garmin196.ac
Normal file → Executable file
|
@ -18,10 +18,10 @@ numsurf 1
|
|||
SURF 0x30
|
||||
mat 2
|
||||
refs 4
|
||||
3 0.625101 0.805353
|
||||
3 0.624958 0.805353
|
||||
2 0.500065 0.805353
|
||||
1 0.500065 0.618334
|
||||
0 0.625101 0.618334
|
||||
1 0.500065 0.621291
|
||||
0 0.624958 0.621291
|
||||
kids 0
|
||||
OBJECT poly
|
||||
name "menu.flights.detail"
|
||||
|
@ -76,9 +76,9 @@ SURF 0x30
|
|||
mat 2
|
||||
refs 4
|
||||
3 0.499712 0.804883
|
||||
2 0.374676 0.804883
|
||||
1 0.374676 0.617864
|
||||
0 0.499712 0.617864
|
||||
2 0.37512 0.804883
|
||||
1 0.37512 0.61816
|
||||
0 0.499712 0.61816
|
||||
kids 0
|
||||
OBJECT poly
|
||||
name "menu.routes.search.mask"
|
||||
|
@ -114,8 +114,8 @@ SURF 0x30
|
|||
mat 2
|
||||
refs 4
|
||||
3 0.249979 0.805294
|
||||
2 0.124943 0.805294
|
||||
1 0.124943 0.618275
|
||||
2 0.125165 0.805294
|
||||
1 0.125165 0.618275
|
||||
0 0.249979 0.618275
|
||||
kids 0
|
||||
OBJECT poly
|
||||
|
@ -190,8 +190,8 @@ SURF 0x30
|
|||
mat 2
|
||||
refs 4
|
||||
0 0.375028 0.804984
|
||||
1 0.249992 0.804984
|
||||
2 0.249992 0.617965
|
||||
1 0.250066 0.804984
|
||||
2 0.250066 0.617965
|
||||
3 0.375028 0.617965
|
||||
kids 0
|
||||
OBJECT poly
|
||||
|
@ -456,8 +456,8 @@ SURF 0x30
|
|||
mat 2
|
||||
refs 4
|
||||
3 0.37485 0.580862
|
||||
2 0.249814 0.580862
|
||||
1 0.249814 0.393843
|
||||
2 0.250113 0.580862
|
||||
1 0.250113 0.393843
|
||||
0 0.37485 0.393843
|
||||
kids 0
|
||||
OBJECT poly
|
||||
|
@ -475,9 +475,9 @@ SURF 0x30
|
|||
mat 2
|
||||
refs 4
|
||||
0 0.499942 0.580206
|
||||
1 0.374906 0.580206
|
||||
2 0.374906 0.393187
|
||||
3 0.499942 0.393187
|
||||
1 0.375105 0.580206
|
||||
2 0.375105 0.393586
|
||||
3 0.499942 0.393586
|
||||
kids 0
|
||||
OBJECT poly
|
||||
name "menu.setup"
|
||||
|
@ -570,8 +570,8 @@ SURF 0x30
|
|||
mat 2
|
||||
refs 4
|
||||
0 0.87481 0.580761
|
||||
1 0.749774 0.580761
|
||||
2 0.749774 0.393742
|
||||
1 0.749955 0.580761
|
||||
2 0.749955 0.393742
|
||||
3 0.87481 0.393742
|
||||
kids 0
|
||||
OBJECT poly
|
||||
|
@ -608,8 +608,8 @@ SURF 0x30
|
|||
mat 2
|
||||
refs 4
|
||||
3 0.999905 0.806015
|
||||
2 0.874869 0.806015
|
||||
1 0.874869 0.618996
|
||||
2 0.875068 0.806015
|
||||
1 0.875068 0.618996
|
||||
0 0.999905 0.618996
|
||||
kids 0
|
||||
OBJECT poly
|
||||
|
@ -721,10 +721,10 @@ numsurf 1
|
|||
SURF 0x30
|
||||
mat 2
|
||||
refs 4
|
||||
0 0.12508 0.580517
|
||||
0 0.124718 0.580517
|
||||
1 4.39182e-005 0.580517
|
||||
2 4.39182e-005 0.393498
|
||||
3 0.12508 0.393498
|
||||
3 0.124718 0.393498
|
||||
kids 0
|
||||
OBJECT poly
|
||||
name "menu.aircraft.profile.fuelflow.mask"
|
||||
|
@ -817,8 +817,8 @@ SURF 0x30
|
|||
mat 2
|
||||
refs 4
|
||||
3 0.749804 0.580378
|
||||
2 0.624767 0.580378
|
||||
1 0.624767 0.393359
|
||||
2 0.62517 0.580378
|
||||
1 0.62517 0.393359
|
||||
0 0.749804 0.393359
|
||||
kids 0
|
||||
OBJECT poly
|
||||
|
@ -836,8 +836,8 @@ SURF 0x30
|
|||
mat 2
|
||||
refs 4
|
||||
0 0.624744 0.580864
|
||||
1 0.499769 0.580864
|
||||
2 0.499769 0.393539
|
||||
1 0.500038 0.580864
|
||||
2 0.500038 0.393539
|
||||
3 0.624744 0.393539
|
||||
kids 0
|
||||
OBJECT poly
|
||||
|
@ -873,10 +873,10 @@ numsurf 1
|
|||
SURF 0x30
|
||||
mat 2
|
||||
refs 4
|
||||
0 0.250177 0.582031
|
||||
1 0.124578 0.582031
|
||||
2 0.124578 0.393908
|
||||
3 0.250177 0.393908
|
||||
0 0.250043 0.580956
|
||||
1 0.12525 0.580956
|
||||
2 0.12525 0.393908
|
||||
3 0.250043 0.393908
|
||||
kids 0
|
||||
OBJECT poly
|
||||
name "popup.nrst_airport"
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -78,7 +78,7 @@ Started October 23 2001 by John Check, fgpanels@rockfish.net
|
|||
<autopilot>
|
||||
<path>Aircraft/c172p/Systems/KAP140.xml</path>
|
||||
</autopilot>
|
||||
<property-rule>
|
||||
<property-rule n="100">
|
||||
<name>FiltersOnly</name>
|
||||
<path>Aircraft/c172p/Systems/NAVandGSfilters.xml</path>
|
||||
</property-rule>
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
<program>
|
||||
<vertex-shader>Shaders/fog.vert</vertex-shader>
|
||||
<fragment-shader>Shaders/fog.frag</fragment-shader>
|
||||
<fragment-shader>Shaders/gbuffer-functions.frag</fragment-shader>
|
||||
</program>
|
||||
<uniform>
|
||||
<name>depth_tex</name>
|
||||
|
|
|
@ -1,25 +1,86 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PropertyList>
|
||||
<name>Effects/lfeat</name>
|
||||
<inherits-from>Effects/terrain-default</inherits-from>
|
||||
<parameters>
|
||||
</parameters>
|
||||
<technique n="1">
|
||||
<pass>
|
||||
<texture-unit>
|
||||
<unit>0</unit>
|
||||
<image><use>texture[0]/image</use></image>
|
||||
<filter><use>texture[0]/filter</use></filter>
|
||||
<wrap-s><use>texture[0]/wrap-s</use></wrap-s>
|
||||
<wrap-t><use>texture[0]/wrap-t</use></wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[0]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<polygon-offset>
|
||||
<factor>-1.0</factor>
|
||||
<units>-1.0</units>
|
||||
</polygon-offset>
|
||||
</pass>
|
||||
</technique>
|
||||
</PropertyList>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PropertyList>
|
||||
<name>Effects/lfeat</name>
|
||||
<inherits-from>Effects/terrain-default</inherits-from>
|
||||
<parameters>
|
||||
<material>
|
||||
<ambient type="vec4d">
|
||||
1.0 1.0 1.0 1.0
|
||||
</ambient>
|
||||
<diffuse type="vec4d">
|
||||
1.0 1.0 1.0 1.0
|
||||
</diffuse>
|
||||
<specular type="vec4d">
|
||||
1.0 1.0 1.0 1.0
|
||||
</specular>
|
||||
<emissive type="vec4d">
|
||||
0.0 0.0 0.0 1.0
|
||||
</emissive>
|
||||
<shininess>1.2</shininess>
|
||||
</material>
|
||||
</parameters>
|
||||
<technique n="1">
|
||||
<pass>
|
||||
<lighting>true</lighting>
|
||||
<material>
|
||||
<ambient>
|
||||
<use>material/ambient</use>
|
||||
</ambient>
|
||||
<diffuse>
|
||||
<use>material/diffuse</use>
|
||||
</diffuse>
|
||||
<specular>
|
||||
<use>material/specular</use>
|
||||
</specular>
|
||||
<emissive>
|
||||
<use>material/emissive</use>
|
||||
</emissive>
|
||||
<shininess>
|
||||
<use>material/shininess</use>
|
||||
</shininess>
|
||||
<color-mode>ambient-and-diffuse</color-mode>
|
||||
</material>
|
||||
<blend>
|
||||
<use>transparent</use>
|
||||
</blend>
|
||||
<alpha-test>
|
||||
<use>transparent</use>
|
||||
</alpha-test>
|
||||
<shade-model>smooth</shade-model>
|
||||
<cull-face>back</cull-face>
|
||||
<render-bin>
|
||||
<bin-number>
|
||||
<use>render-bin/bin-number</use>
|
||||
</bin-number>
|
||||
<bin-name>
|
||||
<use>render-bin/bin-name</use>
|
||||
</bin-name>
|
||||
</render-bin>
|
||||
<texture-unit>
|
||||
<unit>0</unit>
|
||||
<image>
|
||||
<use>texture[0]/image</use>
|
||||
</image>
|
||||
<filter>
|
||||
<use>texture[0]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[0]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[0]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[0]/internal-format</use>
|
||||
</internal-format>
|
||||
<environment>
|
||||
<mode>modulate</mode>
|
||||
</environment>
|
||||
</texture-unit>
|
||||
<polygon-offset>
|
||||
<factor>-1.0</factor>
|
||||
<units>-1.0</units>
|
||||
</polygon-offset>
|
||||
</pass>
|
||||
</technique>
|
||||
</PropertyList>
|
|
@ -36,6 +36,7 @@
|
|||
<program>
|
||||
<vertex-shader>Shaders/light-spot.vert</vertex-shader>
|
||||
<fragment-shader>Shaders/light-point.frag</fragment-shader>
|
||||
<fragment-shader>Shaders/gbuffer-functions.frag</fragment-shader>
|
||||
<attribute>
|
||||
<name>attenuation</name>
|
||||
<index>12</index>
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
<program>
|
||||
<vertex-shader>Shaders/light-spot.vert</vertex-shader>
|
||||
<fragment-shader>Shaders/light-spot.frag</fragment-shader>
|
||||
<fragment-shader>Shaders/gbuffer-functions.frag</fragment-shader>
|
||||
<attribute>
|
||||
<name>attenuation</name>
|
||||
<index>12</index>
|
||||
|
|
|
@ -26,7 +26,6 @@ the objects that use it, and replaces it with the default shader.
|
|||
</and>
|
||||
</or>
|
||||
<extension-supported>GL_EXT_gpu_shader4</extension-supported>
|
||||
<extension-supported>GL_ARB_texture_rg</extension-supported>
|
||||
</and>
|
||||
</predicate>
|
||||
<pass>
|
||||
|
@ -51,8 +50,9 @@ the objects that use it, and replaces it with the default shader.
|
|||
</material>
|
||||
<cull-face>back</cull-face>
|
||||
<program>
|
||||
<vertex-shader n="1">Shaders/ubershader.vert</vertex-shader>
|
||||
<fragment-shader n="1">Shaders/ubershader-gbuffer.frag</fragment-shader>
|
||||
<vertex-shader>Shaders/ubershader.vert</vertex-shader>
|
||||
<fragment-shader>Shaders/ubershader-gbuffer.frag</fragment-shader>
|
||||
<fragment-shader>Shaders/gbuffer-functions.frag</fragment-shader>
|
||||
<!-- <vertex-shader n="1">Shaders/deferred-gbuffer.vert</vertex-shader>
|
||||
<fragment-shader n="1">Shaders/deferred-gbuffer.frag</fragment-shader>-->
|
||||
</program>
|
||||
|
|
|
@ -149,7 +149,6 @@
|
|||
</and>
|
||||
</or>
|
||||
<extension-supported>GL_EXT_gpu_shader4</extension-supported>
|
||||
<extension-supported>GL_ARB_texture_rg</extension-supported>
|
||||
</and>
|
||||
</predicate>
|
||||
<pass>
|
||||
|
@ -189,6 +188,7 @@
|
|||
<program>
|
||||
<vertex-shader>Shaders/deferred-gbuffer.vert</vertex-shader>
|
||||
<fragment-shader>Shaders/deferred-gbuffer.frag</fragment-shader>
|
||||
<fragment-shader>Shaders/gbuffer-functions.frag</fragment-shader>
|
||||
</program>
|
||||
<uniform>
|
||||
<name>texture</name>
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
<program>
|
||||
<vertex-shader>Shaders/sunlight.vert</vertex-shader>
|
||||
<fragment-shader>Shaders/sunlight.frag</fragment-shader>
|
||||
<fragment-shader>Shaders/gbuffer-functions.frag</fragment-shader>
|
||||
</program>
|
||||
<uniform>
|
||||
<name>depth_tex</name>
|
||||
|
|
|
@ -212,7 +212,6 @@
|
|||
</and>
|
||||
</or>
|
||||
<extension-supported>GL_EXT_gpu_shader4</extension-supported>
|
||||
<extension-supported>GL_ARB_texture_rg</extension-supported>
|
||||
</and>
|
||||
</predicate>
|
||||
<pass>
|
||||
|
@ -249,6 +248,7 @@
|
|||
<program>
|
||||
<vertex-shader>Shaders/deferred-gbuffer.vert</vertex-shader>
|
||||
<fragment-shader>Shaders/deferred-gbuffer.frag</fragment-shader>
|
||||
<fragment-shader>Shaders/gbuffer-functions.frag</fragment-shader>
|
||||
</program>
|
||||
<uniform>
|
||||
<name>texture</name>
|
||||
|
|
|
@ -152,8 +152,9 @@
|
|||
<type>noise</type>
|
||||
</texture-unit>
|
||||
<program>
|
||||
<vertex-shader n="1">Shaders/urban-gbuffer.vert</vertex-shader>
|
||||
<fragment-shader n="1">Shaders/urban-gbuffer.frag</fragment-shader>
|
||||
<vertex-shader>Shaders/urban-gbuffer.vert</vertex-shader>
|
||||
<fragment-shader>Shaders/urban-gbuffer.frag</fragment-shader>
|
||||
<fragment-shader>Shaders/gbuffer-functions.frag</fragment-shader>
|
||||
<attribute>
|
||||
<name>tangent</name>
|
||||
<index>6</index>
|
||||
|
@ -313,6 +314,7 @@
|
|||
<program>
|
||||
<vertex-shader>Shaders/urban-gbuffer.vert</vertex-shader>
|
||||
<fragment-shader>Shaders/urban-gbuffer.frag</fragment-shader>
|
||||
<fragment-shader>Shaders/gbuffer-functions.frag</fragment-shader>
|
||||
<attribute>
|
||||
<name>tangent</name>
|
||||
<index>6</index>
|
||||
|
|
|
@ -8,6 +8,9 @@ varying vec3 ecNormal;
|
|||
varying float alpha;
|
||||
uniform int materialID;
|
||||
uniform sampler2D texture;
|
||||
|
||||
vec2 normal_encode(vec3 n);
|
||||
|
||||
void main() {
|
||||
vec4 texel = texture2D(texture, gl_TexCoord[0].st);
|
||||
if (texel.a * alpha < 0.1)
|
||||
|
@ -17,7 +20,7 @@ void main() {
|
|||
float emission = dot( gl_FrontLightModelProduct.sceneColor.rgb, vec3( 0.3, 0.59, 0.11 ) );
|
||||
|
||||
vec3 normal2 = normalize( (2.0 * gl_Color.a - 1.0) * ecNormal );
|
||||
gl_FragData[0] = vec4( (normal2.xy + vec2(1.0,1.0)) * 0.5, 0.0, 1.0 );
|
||||
gl_FragData[0] = vec4( normal_encode(normal2), 0.0, 1.0 );
|
||||
gl_FragData[1] = vec4( gl_Color.rgb * texel.rgb, float( materialID ) / 255.0 );
|
||||
gl_FragData[2] = vec4( specular, shininess / 255.0, emission, 1.0 );
|
||||
gl_FragData[2] = vec4( specular, shininess / 128.0, emission, 1.0 );
|
||||
}
|
||||
|
|
|
@ -6,6 +6,9 @@ uniform vec4 fg_FogColor;
|
|||
uniform float fg_FogDensity;
|
||||
uniform vec3 fg_Planes;
|
||||
varying vec3 ray;
|
||||
|
||||
vec3 position( vec3 viewdir, float depth );
|
||||
|
||||
void main() {
|
||||
vec2 coords = gl_TexCoord[0].xy;
|
||||
float initialized = texture2D( spec_emis_tex, coords ).a;
|
||||
|
@ -16,11 +19,7 @@ void main() {
|
|||
normal.z = sqrt( 1.0 - dot( normal.xy, normal.xy ) );
|
||||
float len = length(normal);
|
||||
normal /= len;
|
||||
vec3 viewDir = normalize(ray);
|
||||
float depth = texture2D( depth_tex, coords ).r;
|
||||
vec3 pos;
|
||||
pos.z = - fg_Planes.y / (fg_Planes.x + depth * fg_Planes.z);
|
||||
pos.xy = viewDir.xy / viewDir.z * pos.z;
|
||||
vec3 pos = position( normalize(ray), texture2D( depth_tex, coords ).r );
|
||||
|
||||
float fogFactor = 0.0;
|
||||
const float LOG2 = 1.442695;
|
||||
|
|
28
Shaders/gbuffer-functions.frag
Normal file
28
Shaders/gbuffer-functions.frag
Normal file
|
@ -0,0 +1,28 @@
|
|||
uniform vec3 fg_Planes;
|
||||
|
||||
// normal compression functions from
|
||||
// http://aras-p.info/texts/CompactNormalStorage.html#method04spheremap
|
||||
vec2 normal_encode(vec3 n)
|
||||
{
|
||||
float p = sqrt(n.z * 8.0 + 8.0);
|
||||
return n.xy / p + 0.5;
|
||||
}
|
||||
|
||||
vec3 normal_decode(vec2 enc)
|
||||
{
|
||||
vec2 fenc = enc * 4.0 - 2.0;
|
||||
float f = dot(fenc,fenc);
|
||||
float g = sqrt(1.0 - f / 4.0);
|
||||
vec3 n;
|
||||
n.xy = fenc * g;
|
||||
n.z = 1.0 - f / 2.0;
|
||||
return n;
|
||||
}
|
||||
|
||||
vec3 position( vec3 viewDir, float depth )
|
||||
{
|
||||
vec3 pos;
|
||||
pos.z = - fg_Planes.y / (fg_Planes.x + depth * fg_Planes.z);
|
||||
pos.xy = viewDir.xy / viewDir.z * pos.z;
|
||||
return pos;
|
||||
}
|
|
@ -15,21 +15,19 @@ uniform float Far;
|
|||
|
||||
varying vec4 ecPosition;
|
||||
|
||||
vec3 position( vec3 viewdir, float depth );
|
||||
vec3 normal_decode(vec2 enc);
|
||||
|
||||
void main() {
|
||||
vec3 ray = ecPosition.xyz / ecPosition.w;
|
||||
vec3 ecPos3 = ray;
|
||||
vec3 viewDir = normalize(ray);
|
||||
vec2 coords = gl_FragCoord.xy / fg_BufferSize;
|
||||
|
||||
float depth = texture2D( depth_tex, coords ).r;
|
||||
vec3 normal;
|
||||
normal.xy = texture2D( normal_tex, coords ).rg * 2.0 - vec2(1.0,1.0);
|
||||
normal.z = sqrt( 1.0 - dot( normal.xy, normal.xy ) );
|
||||
vec3 normal = normal_decode(texture2D( normal_tex, coords ).rg);
|
||||
vec4 spec_emis = texture2D( spec_emis_tex, coords );
|
||||
|
||||
vec3 pos;
|
||||
pos.z = - fg_Planes.y / (fg_Planes.x + depth * fg_Planes.z);
|
||||
pos.xy = viewDir.xy * pos.z / viewDir.z;
|
||||
vec3 pos = position(viewDir, texture2D( depth_tex, coords ).r);
|
||||
|
||||
if ( pos.z < ecPos3.z ) // Negative direction in z
|
||||
discard; // Don't light surface outside the light volume
|
||||
|
|
|
@ -19,21 +19,19 @@ uniform float Far;
|
|||
|
||||
varying vec4 ecPosition;
|
||||
|
||||
vec3 position( vec3 viewdir, float depth );
|
||||
vec3 normal_decode(vec2 enc);
|
||||
|
||||
void main() {
|
||||
vec3 ray = ecPosition.xyz / ecPosition.w;
|
||||
vec3 ecPos3 = ray;
|
||||
vec3 viewDir = normalize(ray);
|
||||
vec2 coords = gl_FragCoord.xy / fg_BufferSize;
|
||||
|
||||
float depth = texture2D( depth_tex, coords ).r;
|
||||
vec3 normal;
|
||||
normal.xy = texture2D( normal_tex, coords ).rg * 2.0 - vec2(1.0,1.0);
|
||||
normal.z = sqrt( 1.0 - dot( normal.xy, normal.xy ) );
|
||||
vec3 normal = normal_decode(texture2D( normal_tex, coords ).rg);
|
||||
vec4 spec_emis = texture2D( spec_emis_tex, coords );
|
||||
|
||||
vec3 pos;
|
||||
pos.z = - fg_Planes.y / (fg_Planes.x + depth * fg_Planes.z);
|
||||
pos.xy = viewDir.xy * pos.z / viewDir.z;
|
||||
vec3 pos = position(viewDir, texture2D( depth_tex, coords ).r);
|
||||
|
||||
if ( pos.z < ecPos3.z ) // Negative direction in z
|
||||
discard; // Don't light surface outside the light volume
|
||||
|
|
|
@ -9,6 +9,10 @@ uniform vec4 fg_SunSpecularColor;
|
|||
uniform vec3 fg_SunDirection;
|
||||
uniform vec3 fg_Planes;
|
||||
varying vec3 ray;
|
||||
|
||||
vec3 position( vec3 viewdir, float depth );
|
||||
vec3 normal_decode(vec2 enc);
|
||||
|
||||
vec4 DynamicShadow( in vec4 ecPosition, out vec4 tint )
|
||||
{
|
||||
vec4 coords;
|
||||
|
@ -44,16 +48,11 @@ void main() {
|
|||
vec4 spec_emis = texture2D( spec_emis_tex, coords );
|
||||
if ( spec_emis.a < 0.1 )
|
||||
discard;
|
||||
vec3 normal;
|
||||
normal.xy = texture2D( normal_tex, coords ).rg * 2.0 - vec2(1.0,1.0);
|
||||
normal.z = sqrt( 1.0 - dot( normal.xy, normal.xy ) );
|
||||
vec3 normal = normal_decode(texture2D( normal_tex, coords ).rg);
|
||||
float len = length(normal);
|
||||
normal /= len;
|
||||
vec3 viewDir = normalize(ray);
|
||||
float depth = texture2D( depth_tex, coords ).r;
|
||||
vec3 pos;
|
||||
pos.z = - fg_Planes.y / (fg_Planes.x + depth * fg_Planes.z);
|
||||
pos.xy = viewDir.xy / viewDir.z * pos.z;
|
||||
vec3 pos = position( viewDir, texture2D( depth_tex, coords ).r );
|
||||
|
||||
vec4 tint;
|
||||
#if 0
|
||||
|
@ -86,7 +85,7 @@ void main() {
|
|||
vec3 Iemis = spec_emis.z * color;
|
||||
if (len > 0.0001) {
|
||||
halfDir /= len;
|
||||
Ispec = pow( clamp( dot( halfDir, normal ), 0.0, 1.0 ), spec_emis.y * 255.0 ) * spec_emis.x * fg_SunSpecularColor.rgb;
|
||||
Ispec = pow( clamp( dot( halfDir, normal ), 0.0, 1.0 ), spec_emis.y * 128.0 ) * spec_emis.x * fg_SunSpecularColor.rgb;
|
||||
}
|
||||
gl_FragColor = vec4(mix(vec3(0.0), Idiff + Ispec, shadow) + Iemis, 1.0);
|
||||
// gl_FragColor = mix(tint, vec4(mix(vec3(0.0), Idiff + Ispec, shadow) + Iemis, 1.0), 0.92);
|
||||
|
|
|
@ -56,6 +56,7 @@ uniform vec3 dirt_g_color;
|
|||
uniform vec3 dirt_b_color;
|
||||
|
||||
//uniform vec4 fg_SunAmbientColor;
|
||||
vec2 normal_encode(vec3 n);
|
||||
|
||||
///fog include//////////////////////
|
||||
uniform int fogType;
|
||||
|
@ -87,7 +88,6 @@ void main (void)
|
|||
} else {
|
||||
N = normalize(VNormal);
|
||||
}
|
||||
vec2 eyeN = (N.xy + vec2(1.0,1.0))*0.5;
|
||||
///END bump
|
||||
vec4 reflection = textureCube(Environment, reflVec * N);
|
||||
vec3 viewVec = normalize(vViewVec);
|
||||
|
@ -167,16 +167,20 @@ void main (void)
|
|||
lightmap_g_color * lightmap_g_factor * lightmapTexel.g +
|
||||
lightmap_b_color * lightmap_b_factor * lightmapTexel.b +
|
||||
lightmap_a_color * lightmap_a_factor * lightmapTexel.a ;
|
||||
emission = max(max(lightmap_r_factor * lightmapTexel.r, lightmap_g_factor * lightmapTexel.g),max( lightmap_b_factor * lightmapTexel.b, lightmap_a_factor * lightmapTexel.a));
|
||||
} else {
|
||||
lightmapcolor = lightmapTexel.rgb * lightmap_r_color * lightmap_r_factor;
|
||||
lightmapcolor = lightmapTexel.r * lightmap_r_color * lightmap_r_factor;
|
||||
emission = lightmapTexel.r * lightmap_r_factor;
|
||||
}
|
||||
fragColor.rgb = max(fragColor.rgb, lightmapcolor * gl_FrontMaterial.diffuse.rgb * mixedcolor);
|
||||
//fragColor.rgb = max(fragColor.rgb, lightmapcolor * gl_FrontMaterial.diffuse.rgb * mixedcolor);
|
||||
emission = length(lightmapcolor);
|
||||
fragColor.rgb = max(fragColor.rgb * (1.0 - emission), lightmapcolor * gl_FrontMaterial.diffuse.rgb * mixedcolor);
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// END lightmap
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
gl_FragData[0]=vec4(eyeN, 0.0, 1.0);
|
||||
gl_FragData[0]=vec4(normal_encode(N), 0.0, 1.0);
|
||||
gl_FragData[1]=vec4(fragColor.rgb,1.0/255.0);
|
||||
gl_FragData[2]=vec4(specular, gl_FrontMaterial.shininess/255.0, emission, 1.0);
|
||||
gl_FragData[2]=vec4(specular, gl_FrontMaterial.shininess/128.0, emission, 1.0);
|
||||
}
|
|
@ -37,6 +37,8 @@ int linear_search_steps = 10;
|
|||
int GlobalIterationCount = 0;
|
||||
int gIterationCap = 64;
|
||||
|
||||
vec2 normal_encode(vec3 n);
|
||||
|
||||
void QDM(inout vec3 p, inout vec3 v)
|
||||
{
|
||||
const int MAX_LEVEL = TEXTURE_MIP_LEVELS;
|
||||
|
@ -184,7 +186,7 @@ void main (void)
|
|||
N.z = sqrt(1.0 - min(1.0,dot(N.xy, N.xy)));
|
||||
float Nz = N.z;
|
||||
N = normalize(N.x * VTangent + N.y * VBinormal + N.z * VNormal);
|
||||
gl_FragData[0] = vec4( (N.xy + vec2(1.0,1.0)) * 0.5, 0.0, 1.0 );
|
||||
gl_FragData[0] = vec4( normal_encode(N), 0.0, 1.0 );
|
||||
|
||||
vec4 ambient_light = constantColor + vec4(gl_Color.rgb, 1.0);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue