beacon beam fix=

This commit is contained in:
Xonk 2023-07-05 20:03:21 -04:00
parent 45326d733c
commit 7119baabb3
2 changed files with 24 additions and 27 deletions

View File

@ -1,10 +1,15 @@
#version 120
varying vec4 lmtexcoord;
varying vec4 color;
varying vec2 texcoord;
uniform sampler2D texture;
//faster and actually more precise than pow 2.2
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));
@ -29,16 +34,14 @@ float encodeVec2(float x,float y){
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
/* DRAWBUFFERS:18 */
/* DRAWBUFFERS:28 */
void main() {
vec3 albedo = texture2D(texture, lmtexcoord.xy).rgb * color.rgb;
vec4 Albedo = vec4(texture2D(texture, texcoord).rgb*5.0,1.0);
Albedo *= color;
Albedo.rgb = toLinear(Albedo.rgb);
vec4 data1 = clamp(encode(vec3(0.0), vec2(lmtexcoord.z,1)), 0.0, 1.0);
gl_FragData[0] = vec4(encodeVec2(albedo.r,data1.x), encodeVec2(albedo.g,data1.y), encodeVec2(albedo.b,data1.z), encodeVec2(data1.w,0.75));
gl_FragData[1].a = 0.9;
gl_FragData[0] = Albedo;
gl_FragData[1] = vec4(0.0,0.0,0.0,0.9);
}

View File

@ -11,22 +11,19 @@ Read the terms of modification and sharing before changing something below pleas
!! DO NOT REMOVE !!
*/
varying vec4 lmtexcoord;
varying vec4 color;
varying vec2 texcoord;
uniform vec2 texelSize;
uniform int framemod8;
const vec2[8] offsets = vec2[8](vec2(1./8.,-3./8.),
vec2(-1.,3.)/8.,
vec2(5.0,1.)/8.,
vec2(-3,-5.)/8.,
vec2(-5.,5.)/8.,
vec2(-7.,-1.)/8.,
vec2(3,7.)/8.,
vec2(7.,-7.)/8.);
const vec2[8] offsets = vec2[8](vec2(1./8.,-3./8.),
vec2(-1.,3.)/8.,
vec2(5.0,1.)/8.,
vec2(-3,-5.)/8.,
vec2(-5.,5.)/8.,
vec2(-7.,-1.)/8.,
vec2(3,7.)/8.,
vec2(7.,-7.)/8.);
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
@ -37,14 +34,11 @@ void main() {
gl_Position = ftransform();
lmtexcoord.xy = (gl_MultiTexCoord0).xy;
vec2 lmcoord = gl_MultiTexCoord1.xy/255.;
lmtexcoord.zw = lmcoord;
color = gl_Color;
if(gl_Color.a < 1.0 ) gl_Position = vec4(10,10,10,1);
texcoord = (gl_MultiTexCoord0).xy;
color = gl_Color;
#ifdef TAA_UPSCALING
gl_Position.xy = gl_Position.xy * RENDER_SCALE + RENDER_SCALE * gl_Position.w - gl_Position.w;
#endif