finally frame buffer rendering is working
This commit is contained in:
1 parent
e690d0f8e2
commit
29834d528a
20 files changed
+601
-164
No files matched your search
@@ -90,8 +90,8 @@ void main()
|
||||
// 4. Смешивание цвета с туманом
|
||||
|
||||
//vec3 mountainColor = vec3((length(pos+vec3(0.0,0.0,45000.0))-20000.0)/100.0, 0.5,0.0);
|
||||
gl_FragColor = mix(vec4(uColor* finalColor.rgb, 1.0), FOG_COLOR, fogFactor);
|
||||
//gl_FragColor = mix(vec4(uColor* finalColor.rgb, 1.0), FOG_COLOR, fogFactor);
|
||||
//gl_FragColor = vec4((length(pos+vec3(0.0,0.0,45000.0))-20000.0)/100.0, 0.0,0.0, 1.0);
|
||||
//gl_FragColor = vec4(fogFactor, 0.5,0.5, 1.0);
|
||||
//gl_FragColor = vec4(uColor*textureColor.rgb, 1.0);
|
||||
gl_FragColor = vec4(textureColor.rgb, 1.0);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// Вершинный шейдер (Vertex Shader)
|
||||
|
||||
attribute vec3 vPosition;
|
||||
attribute vec2 vTexCoord;
|
||||
|
||||
|
||||
varying vec2 TexCoord;
|
||||
|
||||
uniform mat4 ProjectionModelViewMatrix;
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
gl_Position = ProjectionModelViewMatrix * vec4(vPosition.xyz, 1.0);
|
||||
|
||||
TexCoord = vTexCoord;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// Fragment Shader
|
||||
varying vec2 TexCoord;
|
||||
uniform sampler2D Texture; // sandTexture
|
||||
uniform sampler2D StoneMap; // Наша запеченная текстура
|
||||
uniform float testShift1;
|
||||
uniform float testShift2;
|
||||
void main()
|
||||
{
|
||||
vec2 newTexCoord;
|
||||
newTexCoord.x = TexCoord.x;
|
||||
//newTexCoord.y = 1.0 - TexCoord.y - 0.0122;
|
||||
//newTexCoord.y = TexCoord.y * (1.0+testShift) + 0.0122;
|
||||
//newTexCoord.y = (TexCoord.y + 0.0122)*(1.0 +x/500.0);
|
||||
newTexCoord.y = TexCoord.y * (1.0-6.0/500.0) + 0.0122+ (11.0/500.0) *0.1 -6/5000.0;
|
||||
//newTexCoord.y = TexCoord.y;
|
||||
vec4 sandColor = texture2D(Texture, TexCoord);
|
||||
vec4 stoneData = texture2D(StoneMap, newTexCoord);
|
||||
|
||||
//vec3 finalColor = sandColor.rgb*0.5 + stoneData.rgb*0.5;
|
||||
vec3 finalColor = stoneData.rgb;
|
||||
//vec3 finalColor = sandColor.rgb;
|
||||
|
||||
gl_FragColor = vec4(finalColor, 1.0);
|
||||
}
|
||||
Reference in new issue
Block a user