mirror of
https://git.stillkill.net/MinecraftLeak/MinecraftLegends.git
synced 2026-10-22 13:22:20 +01:00
Initial commit
This commit is contained in:
commit
86efc669e9
5013 files changed
+237743
No files matched your search
+94
@@ -0,0 +1,94 @@
|
||||
// __multiversion__
|
||||
// This signals the loading code to prepend either #version 100 or #version 300 es as apropriate.
|
||||
|
||||
// To use centroid sampling we need to have version 300 es shaders, which requires changing:
|
||||
// attribute to in
|
||||
// varying to out when in vertex shaders or in when in fragment shaders
|
||||
// defining an out vec4 FragColor and replacing uses of gl_FragColor with FragColor
|
||||
// texture2D to texture
|
||||
#if __VERSION__ >= 300
|
||||
|
||||
// version 300 code
|
||||
|
||||
#ifdef MSAA_FRAMEBUFFER_ENABLED
|
||||
#define _centroid centroid
|
||||
#else
|
||||
#define _centroid
|
||||
#endif
|
||||
|
||||
#ifndef BYPASS_PIXEL_SHADER
|
||||
#if defined(TEXEL_AA) && defined(TEXEL_AA_FEATURE)
|
||||
_centroid in highp vec2 uv0;
|
||||
_centroid in highp vec2 uv1;
|
||||
#else
|
||||
_centroid in vec2 uv0;
|
||||
_centroid in vec2 uv1;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define varying in
|
||||
#define texture2D texture
|
||||
out vec4 FragColor;
|
||||
#define gl_FragColor FragColor
|
||||
#else
|
||||
|
||||
// version 100 code
|
||||
|
||||
#ifndef BYPASS_PIXEL_SHADER
|
||||
varying vec2 uv0;
|
||||
varying vec2 uv1;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
varying vec4 color;
|
||||
|
||||
#ifdef FOG
|
||||
varying vec4 fogColor;
|
||||
#endif
|
||||
|
||||
#ifdef NEAR_WATER
|
||||
varying float cameraDist;
|
||||
#endif
|
||||
|
||||
#include "shaders/util.h"
|
||||
|
||||
uniform sampler2D TEXTURE_0;
|
||||
uniform sampler2D TEXTURE_1;
|
||||
uniform sampler2D TEXTURE_2;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 diffuse = texture2D( TEXTURE_0, uv0 );
|
||||
|
||||
vec4 inColor = color;
|
||||
|
||||
#ifdef SEASONS_FAR
|
||||
diffuse.a = 1.0;
|
||||
inColor.b = 1.0;
|
||||
#endif
|
||||
|
||||
if(diffuse.a <= 0.0)
|
||||
discard;
|
||||
|
||||
diffuse = diffuse * texture2D( TEXTURE_1, uv1 );
|
||||
|
||||
#ifndef SEASONS
|
||||
|
||||
diffuse.rgb *= mix(vec3(1.0, 1.0, 1.0), inColor.rgb, diffuse.a);
|
||||
diffuse.a = 1.0;
|
||||
|
||||
#else
|
||||
vec2 uv = inColor.xy;
|
||||
inColor.b = mix(0.0, color.b, diffuse.a);
|
||||
diffuse.rgb *= mix(vec3(1.0,1.0,1.0), texture2D( TEXTURE_2, uv).rgb*2.0, inColor.b);
|
||||
diffuse.rgb *= inColor.aaa;
|
||||
diffuse.a = 1.0;
|
||||
#endif
|
||||
|
||||
#ifdef FOG
|
||||
diffuse.rgb = mix( diffuse.rgb, fogColor.rgb, fogColor.a );
|
||||
#endif
|
||||
|
||||
gl_FragColor = diffuse;
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
#include "ShaderConstants.fxh"
|
||||
#include "Util.fxh"
|
||||
|
||||
struct PS_Input
|
||||
{
|
||||
float4 position : SV_Position;
|
||||
|
||||
#ifndef BYPASS_PIXEL_SHADER
|
||||
lpfloat4 color : COLOR;
|
||||
snorm float2 uv0 : TEXCOORD_0_FB_MSAA;
|
||||
snorm float2 uv1 : TEXCOORD_1_FB_MSAA;
|
||||
#endif
|
||||
|
||||
#ifdef NEAR_WATER
|
||||
float cameraDist : TEXCOORD_2;
|
||||
#endif
|
||||
|
||||
#ifdef FOG
|
||||
float4 fogColor : FOG_COLOR;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct PS_Output
|
||||
{
|
||||
float4 color : SV_Target;
|
||||
};
|
||||
|
||||
void main( in PS_Input PSInput, out PS_Output PSOutput )
|
||||
{
|
||||
float4 diffuse = TEXTURE_0.Sample(TextureSampler0, PSInput.uv0);
|
||||
|
||||
#ifdef SEASONS_FAR
|
||||
diffuse.a = 1.0f;
|
||||
PSInput.color.b = 1.0f;
|
||||
#endif
|
||||
|
||||
//If we know that all the verts in a triangle will have the same alpha, we should cull there first.
|
||||
if (diffuse.a <= 0.0f) {
|
||||
discard;
|
||||
}
|
||||
|
||||
diffuse = diffuse * TEXTURE_1.Sample(TextureSampler1, PSInput.uv1);
|
||||
|
||||
#ifndef SEASONS
|
||||
|
||||
diffuse.rgb *= lerp(1.0f, PSInput.color.rgb, diffuse.a);
|
||||
diffuse.a = 1.0f;
|
||||
|
||||
#else
|
||||
float2 uv = PSInput.color.xy;
|
||||
PSInput.color.b = lerp(0.0f, PSInput.color.b, diffuse.a);
|
||||
diffuse.rgb *= lerp(1.0f, TEXTURE_2.Sample(TextureSampler2, uv).rgb*2.0f, PSInput.color.b);
|
||||
diffuse.rgb *= PSInput.color.aaa;
|
||||
diffuse.a = 1.0f;
|
||||
#endif
|
||||
|
||||
#ifdef FOG
|
||||
diffuse.rgb = lerp( diffuse.rgb, PSInput.fogColor.rgb, PSInput.fogColor.a );
|
||||
#endif
|
||||
|
||||
PSOutput.color = diffuse;
|
||||
|
||||
#ifdef VR_MODE
|
||||
// On Rift, the transition from 0 brightness to the lowest 8 bit value is abrupt, so clamp to
|
||||
// the lowest 8 bit value.
|
||||
PSOutput.color = max(PSOutput.color, 1 / 255.0f);
|
||||
#endif
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user