First blood

This commit is contained in:
vladislav.khorev committed 2013-02-10 15:24:11 +00:00
1 parent 172a38114f
commit 3f3c1735d6
65 files changed
+2853

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 768 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

+10
View File
@@ -0,0 +1,10 @@
precision lowp float;
uniform sampler2D Texture;
varying vec2 texCoord;
void main()
{
vec4 texColor = texture2D(Texture,texCoord).rgba;
gl_FragColor = vec4(texColor.rgb, texColor.a);
}
+11
View File
@@ -0,0 +1,11 @@
attribute vec3 vPosition;
attribute vec2 vTexCoord;
varying vec2 texCoord;
uniform mat4 ProjectionMatrix;
void main()
{
//480x320
gl_Position = ProjectionMatrix * vec4(vPosition.xyz, 1.0);
texCoord = vTexCoord;
}
+13
View File
@@ -0,0 +1,13 @@
precision lowp float;
uniform sampler2D Texture;
varying vec2 texCoord;
varying vec3 vertexPos;
void main()
{
vec4 texColor = texture2D(Texture,texCoord).rgba;
gl_FragColor = vec4(texColor.rgb, texColor.a); //day
}
+13
View File
@@ -0,0 +1,13 @@
attribute vec3 vPosition;
attribute vec2 vTexCoord;
varying vec2 texCoord;
varying vec3 vertexPos;
uniform mat4 ProjectionMatrix;
void main()
{
//480x320
gl_Position = ProjectionMatrix * vec4(vPosition.xyz, 1.0);
vertexPos = vPosition.xyz;
texCoord = vTexCoord;
}
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+29
View File
@@ -0,0 +1,29 @@
<Ices>
<Ice><ModelName>ice1.lm1</ModelName><PosX>0.0</PosX><PosZ>13.0</PosZ><Angle>110</Angle><Scale>2.0</Scale></Ice>
<Ice><ModelName>ice2.lm1</ModelName><PosX>-3.0</PosX><PosZ>14.0</PosZ><Angle>70</Angle></Ice>
<Ice><ModelName>ice3.lm1</ModelName><PosX>-4.0</PosX><PosZ>15.0</PosZ><Angle>160</Angle><Scale>2.0</Scale></Ice>
<Ice><ModelName>ice6.lm1</ModelName><PosX>7.0</PosX><PosZ>13.5</PosZ><Angle>240</Angle></Ice>
<Ice><ModelName>ice4.lm1</ModelName><PosX>4.0</PosX><PosZ>15.0</PosZ><Scale>1.4</Scale></Ice>
<Ice><ModelName>ice5.lm1</ModelName><PosX>-6.0</PosX><PosZ>14.0</PosZ><Angle>60</Angle></Ice>
<Ice><ModelName>ice6.lm1</ModelName><PosX>-1.0</PosX><PosZ>14.0</PosZ></Ice>
<Ice><ModelName>ice1.lm1</ModelName><PosX>5.0</PosX><PosZ>13.0</PosZ><Scale>1.3</Scale></Ice>
<Ice><ModelName>ice3.lm1</ModelName><PosX>-5.0</PosX><PosZ>15.0</PosZ><Angle>30</Angle></Ice>
<Ice><ModelName>ice6.lm1</ModelName><PosX>9.0</PosX><PosZ>12.0</PosZ></Ice>
<Ice><ModelName>ice4.lm1</ModelName><PosX>11.0</PosX><PosZ>11.0</PosZ><Angle>130</Angle><Scale>2.1</Scale></Ice>
<Ice><ModelName>ice4.lm1</ModelName><PosX>13.0</PosX><PosZ>10.0</PosZ><Angle>240</Angle><Scale>1.5</Scale></Ice>
<Ice><ModelName>ice1.lm1</ModelName><PosX>14.0</PosX><PosZ>6.0</PosZ></Ice>
<Ice><ModelName>ice2.lm1</ModelName><PosX>16.0</PosX><PosZ>4.5</PosZ><Scale>1.8</Scale></Ice>
<Ice><ModelName>ice3.lm1</ModelName><PosX>18.0</PosX><PosZ>2.0</PosZ><Angle>340</Angle></Ice>
<Ice><ModelName>ice4.lm1</ModelName><PosX>17.0</PosX><PosZ>2.0</PosZ><Scale>2.0</Scale></Ice>
<Ice><ModelName>ice2.lm1</ModelName><PosX>18.0</PosX><PosZ>-1.5</PosZ><Angle>60</Angle><Scale>1.5</Scale></Ice>
<Ice><ModelName>ice1.lm1</ModelName><PosX>15.0</PosX><PosZ>-5.5</PosZ><Angle>130</Angle><Scale>2.0</Scale></Ice>
<Ice><ModelName>ice5.lm1</ModelName><PosX>12.0</PosX><PosZ>-8.0</PosZ><Angle>160</Angle></Ice>
</Ices>
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 385 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

+56
View File
@@ -0,0 +1,56 @@
precision lowp float;
uniform sampler2D Texture;
uniform sampler2D NormalMap;
uniform vec3 CamPos;
uniform float WaterScale;
varying vec2 texCoord;
uniform float Time;
void main()
{
vec2 localTexCoord = texCoord;
vec3 camVec = CamPos.xyz;
float len = length(camVec);
float squeeze = 0.5*(len / CamPos.y );
squeeze = min(squeeze, 4.0);
//if (squeeze>15.0) squeeze = 15.0;
vec3 v3 = vec3(0.0,1.0,0.0);
vec3 v2 = vec3(1.0,0.0,0.0);
vec3 v1 = vec3(0.0,0.0,1.0);
mat3 rot;
rot[0] = v1;
rot[1] = v2;
rot[2] = v3;
float sinx = 0.025*sin(Time+localTexCoord.x*2.0);
vec3 NVec1 = texture2D(NormalMap, vec2(-Time*0.04 + localTexCoord.x*WaterScale + sinx, -Time*0.04 + squeeze*localTexCoord.y*WaterScale - sinx)).rgb;
vec3 NVec2 = texture2D(NormalMap, vec2( Time*0.04 + squeeze*localTexCoord.y*WaterScale - sinx, -Time*0.04 + (1.0-localTexCoord.x)*WaterScale + sinx)).rgb;
NVec1 = (NVec1 -0.5) * 2.0;
NVec2 = (NVec2 -0.5) * 2.0;
vec3 NVec = 0.5*NVec1 + 0.5*NVec2;
NVec = rot * NVec;
float d = 1.0/(len+0.05);
d = min(d, 2.0);
localTexCoord.x = max(min(localTexCoord.x + d * NVec.x, 1.0), 0.0);
localTexCoord.y = max(min(localTexCoord.y - d * NVec.z, 1.0), 0.0);
vec4 specular = vec4(0.8, 0.8, 0.8, 1.0)* (1.0-pow(max(dot(vec3(0.0,1.0,0.0), normalize(NVec)),0.0),2.0));
gl_FragColor = texture2D(Texture, localTexCoord).rgba + specular + vec4(0.0, 0.05, 0.1, 0.0);
}
+12
View File
@@ -0,0 +1,12 @@
attribute vec3 vPosition;
attribute vec3 Normal;
attribute vec2 vTexCoord;
varying vec2 texCoord;
uniform mat4 ProjectionMatrix;
void main()
{
//480x320
gl_Position = ProjectionMatrix * vec4(vPosition.xyz, 1.0);
texCoord = vTexCoord;
}
+34
View File
@@ -0,0 +1,34 @@
precision lowp float;
uniform sampler2D Texture;
uniform sampler2D NormalMap;
uniform vec3 LightDirection;
varying vec2 texCoord;
varying vec3 camVec;
varying vec3 normVec;
void main()
{
vec3 cVec = normalize(camVec);
float parallax = 0.035;
//double refinement
float height = texture2D(NormalMap, texCoord.xy).a;
float offset = parallax * (2.0 * height - 1.0);
vec2 parallaxTexCoord = texCoord.xy + offset * cVec.xy;
height += texture2D(NormalMap, parallaxTexCoord).a;
offset = parallax * (height - 1.0);
parallaxTexCoord = texCoord.xy + offset * cVec.xy;
vec3 nvec = normalize(normVec);
float cosf = max(0.0, dot(nvec, -LightDirection));
gl_FragColor = vec4((texture2D(Texture, parallaxTexCoord).rgb * (cosf * 0.75 + 0.25)), 1.0);
}
+30
View File
@@ -0,0 +1,30 @@
attribute vec3 vPosition;
attribute vec3 Normal;
attribute vec3 Tangent;
attribute vec3 Binormal;
attribute vec2 vTexCoord;
uniform mat4 ProjectionMatrix;
uniform vec3 CamPos;
varying vec2 texCoord;
varying vec3 camVec;
varying vec3 normVec;
void main()
{
//480x320
gl_Position = ProjectionMatrix * vec4(vPosition.xyz, 1.0);
texCoord = vTexCoord;
vec3 cVec = (CamPos - vPosition.xyz);
mat3 rot;
rot[0] = Tangent;
rot[1] = Binormal;
rot[2] = Normal;
camVec = cVec * rot;
normVec = Normal;
}
+26
View File
@@ -0,0 +1,26 @@
precision lowp float;
uniform sampler2D Texture;
uniform sampler2D NormalMap;
uniform vec3 LightDirection;
uniform float TimeOfDayCoef1;
uniform float TimeOfDayCoef2;
uniform vec3 TimeOfDayColor;
varying vec2 texCoord;
varying vec3 camVec;
varying vec3 normVec;
void main()
{
vec3 nvec = normalize(normVec);
float cosf = max(0.0, dot(nvec, -LightDirection));
//gl_FragColor = vec4((texture2D(Texture, texCoord).rgb * (cosf * 0.75 + 0.25)), 1.0); //day
//gl_FragColor = vec4((texture2D(Texture, texCoord).rgb * (cosf * 0.5 + 0.25)), 1.0); //twilight
//gl_FragColor = vec4(((texture2D(Texture, texCoord).rgb + vec3(0.0, 0.1, 0.2)) * (0.4)), 1.0);
gl_FragColor = vec4(((texture2D(Texture, texCoord).rgb + TimeOfDayColor) * (cosf * TimeOfDayCoef1 + TimeOfDayCoef2)), 1.0);
}
+30
View File
@@ -0,0 +1,30 @@
attribute vec3 vPosition;
attribute vec3 Normal;
attribute vec3 Tangent;
attribute vec3 Binormal;
attribute vec2 vTexCoord;
uniform mat4 ProjectionMatrix;
uniform vec3 CamPos;
varying vec2 texCoord;
varying vec3 camVec;
varying vec3 normVec;
void main()
{
//480x320
gl_Position = ProjectionMatrix * vec4(vPosition.xyz, 1.0);
texCoord = vTexCoord;
vec3 cVec = (CamPos - vPosition.xyz);
mat3 rot;
rot[0] = Tangent;
rot[1] = Binormal;
rot[2] = Normal;
camVec = cVec * rot;
normVec = Normal;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB