mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-06-27 10:42:31 +08:00
combine end and nether shaders into one group of programs. for my own ease of use.
This commit is contained in:
@ -1,9 +1,10 @@
|
||||
#version 120
|
||||
|
||||
#include "/lib/settings.glsl"
|
||||
|
||||
varying vec4 color;
|
||||
varying vec4 lmtexcoord;
|
||||
varying vec2 texcoord;
|
||||
|
||||
varying vec4 color;
|
||||
uniform sampler2D texture;
|
||||
|
||||
//faster and actually more precise than pow 2.2
|
||||
@ -11,24 +12,6 @@ vec3 toLinear(vec3 sRGB){
|
||||
return sRGB * (sRGB * (sRGB * 0.305306011 + 0.682171111) + 0.012522878);
|
||||
}
|
||||
|
||||
vec4 encode (vec3 n, vec2 lightmaps){
|
||||
n.xy = n.xy / dot(abs(n), vec3(1.0));
|
||||
n.xy = n.z <= 0.0 ? (1.0 - abs(n.yx)) * sign(n.xy) : n.xy;
|
||||
vec2 encn = clamp(n.xy * 0.5 + 0.5,-1.0,1.0);
|
||||
|
||||
return vec4(encn,vec2(lightmaps.x,lightmaps.y));
|
||||
}
|
||||
|
||||
//encoding by jodie
|
||||
float encodeVec2(vec2 a){
|
||||
const vec2 constant1 = vec2( 1., 256.) / 65535.;
|
||||
vec2 temp = floor( a * 255. );
|
||||
return temp.x*constant1.x+temp.y*constant1.y;
|
||||
}
|
||||
float encodeVec2(float x,float y){
|
||||
return encodeVec2(vec2(x,y));
|
||||
}
|
||||
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
@ -38,12 +21,9 @@ float encodeVec2(float x,float y){
|
||||
|
||||
void main() {
|
||||
|
||||
vec4 Albedo = texture2D(texture, texcoord);
|
||||
vec4 Albedo = texture2D(texture, texcoord.xy) * color;
|
||||
|
||||
gl_FragData[0] = vec4(toLinear(Albedo.rgb), Albedo.a);
|
||||
gl_FragData[1] = vec4(0.0, 0.0, 0.0, 0.5);
|
||||
|
||||
Albedo *= color;
|
||||
Albedo.rgb = toLinear(Albedo.rgb);
|
||||
|
||||
gl_FragData[0] = Albedo;
|
||||
|
||||
gl_FragData[1] = vec4(0.0,0.0,0.0,0.5);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user