Add colorwheel support, update create block support

This commit is contained in:
Merlin1809
2025-10-07 23:04:14 +02:00
parent 2fd0b407c9
commit 97b81716d4
46 changed files with 1077 additions and 147 deletions
File diff suppressed because one or more lines are too long
+25
View File
@@ -0,0 +1,25 @@
blend.clrwl_gbuffers_translucent = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE
blend.clrwl_gbuffers_translucent.colortex11 = off
blend.clrwl_gbuffers_glint = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE
blend.clrwl_gbuffers_damagedblock = off
blend.clrwl_shadow = SRC_COLOR ZERO ONE ZERO
oit = true
oit.gbuffers.coefficientRanks = 3,3
oit.gbuffers.colortex2 = 0
oit.gbuffers.colortex2.format = RGBA16F
oit.gbuffers.colortex7 = 1
oit.gbuffers.colortex7.format = RGBA16F
oit.gbuffers.colortex11 = frontmost
oit.gbuffers.colortex11.format = RGBA16
oit.gbuffers.colortex14 = frontmost
oit.gbuffers.colortex14.format = RGBA16
#ifndef RENDER_ENTITY_SHADOWS
shadow.enabled = false
#endif
+24 -7
View File
@@ -1,3 +1,18 @@
#ifdef IS_LPV_ENABLED
#extension GL_EXT_shader_image_load_store: enable
#extension GL_ARB_shading_language_packing: enable
#endif
#if defined DAMAGE_BLOCK_EFFECT && defined POM
#extension GL_ARB_shader_texture_lod : enable
#endif
#if defined CUMULONIMBUS_LIGHTNING && CUMULONIMBUS > 0 && defined OVERWORLD_SHADER && defined COLORWHEEL
#extension GL_NV_gpu_shader5 : enable
#extension GL_ARB_shader_image_load_store : enable
#extension GL_EXT_shader_image_load_store : enable
#endif
#include "/lib/settings.glsl"
#if defined CUSTOM_MOON_ROTATION || defined END_ISLAND_LIGHT
@@ -8,11 +23,6 @@
// #undef IS_LPV_ENABLED
// #endif
#ifdef IS_LPV_ENABLED
#extension GL_EXT_shader_image_load_store: enable
#extension GL_ARB_shading_language_packing: enable
#endif
#include "/lib/res_params.glsl"
varying vec4 lmtexcoord;
@@ -211,8 +221,6 @@ float ComputeShadowMap(inout vec3 directLightColor, vec3 playerPos, float maxDis
#endif
#if defined DAMAGE_BLOCK_EFFECT && defined POM
#extension GL_ARB_shader_texture_lod : enable
mat3 inverseMatrix(mat3 m) {
float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];
float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];
@@ -363,6 +371,15 @@ void main() {
vec4 Albedo = texture2D(texture, adjustedTexCoord.xy);
#endif
#ifdef COLORWHEEL
float ao;
vec4 overlayColor;
vec2 lmcoord = lmtexcoord.zw;
clrwl_computeFragment(Albedo, Albedo, lmcoord, ao, overlayColor);
Albedo.rgb = mix(Albedo.rgb, overlayColor.rgb, clamp(overlayColor.a*1.5,0,1));
#endif
Albedo.rgb = toLinear(Albedo.rgb);
// if(dot(Albedo.rgb, vec3(0.33333)) < 1.0/255.0 || Albedo.a < 0.01 ) { discard; return; }
+61 -41
View File
@@ -22,8 +22,9 @@ flat in int NameTags;
#define MC_NORMAL_MAP
#endif
in float VanillaAO;
#ifndef COLORWHEEL
in float VanillaAO;
#endif
const float mincoord = 1.0/4096.0;
const float maxcoord = 1.0-mincoord;
@@ -361,44 +362,9 @@ void main() {
vec3 playerpos = mat3(gbufferModelViewInverse) * fragpos + gbufferModelViewInverse[3].xyz;
vec3 worldpos = playerpos + cameraPosition;
float torchlightmap = lmtexcoord.z;
#if defined Hand_Held_lights && !defined LPV_ENABLED
#ifdef IS_IRIS
vec3 playerCamPos = cameraPosition - relativeEyePosition;
#else
vec3 playerCamPos = cameraPosition;
#endif
#ifdef VIVECRAFT
if (vivecraftIsVR) {
playerCamPos = cameraPosition - vivecraftRelativeMainHandPos;
}
#endif
float HELD_ITEM_BRIGHTNESS = 0.0;
if(heldItemId > 999 || heldItemId2 > 999 ) HELD_ITEM_BRIGHTNESS = 0.9;
// if(HELD_ITEM_BRIGHTNESS > 0.0) torchlightmap = max(torchlightmap, HELD_ITEM_BRIGHTNESS * clamp( pow(max(1.0-length(worldpos-playerCamPos)/HANDHELD_LIGHT_RANGE,0.0),1.5),0.0,1.0));
if(HELD_ITEM_BRIGHTNESS > 0.0){
float pointLight = clamp(1.0-(length(worldpos-playerCamPos)-1.)/HANDHELD_LIGHT_RANGE,0.0,1.0);
if (torchlightmap < 0.99) {
torchlightmap = mix(torchlightmap, HELD_ITEM_BRIGHTNESS, pointLight);
}
}
#ifdef HAND
torchlightmap *= 0.9;
#endif
#endif
float lightmap = clamp( (lmtexcoord.w-0.9) * 10.0,0.,1.);
vec2 adjustedTexCoord = lmtexcoord.xy;
#if defined POM && defined WORLD && !defined ENTITIES && !defined HAND
#if defined POM && (defined WORLD && !defined ENTITIES && !defined HAND || defined COLORWHEEL)
// vec2 tempOffset=offsets[framemod8];
adjustedTexCoord = fract(texcoord.st)*texcoordam.pq+texcoordam.st;
// vec3 fragpos = toScreenSpace(gl_FragCoord.xyz*vec3(texelSize/RENDER_SCALE,1.0)-vec3(vec2(tempOffset)*texelSize*0.5,0.0));
@@ -463,9 +429,20 @@ void main() {
float textureLOD = bias();
vec4 Albedo = color;
vec2 lmcoord = lmtexcoord.zw;
#ifndef COLORWHEEL
vec4 Albedo = color;
if (ISSHADERGRASS < 1) Albedo *= texture2D_POMSwitch(texture, adjustedTexCoord.xy, vec4(dcdx,dcdy), ifPOM, textureLOD);
#else
vec4 Albedo = texture2D_POMSwitch(texture, adjustedTexCoord.xy, vec4(dcdx,dcdy), ifPOM, textureLOD);
vec4 overlayColor;
float VanillaAO;
clrwl_computeFragment(Albedo, Albedo, lmcoord, VanillaAO, overlayColor);
lmcoord = clamp((lmcoord - 1.0 / 32.0) * 32.0 / 30.0, 0.0, 1.0);
VanillaAO = 1.0 - clamp(VanillaAO, 0,1);
#endif
#if REPLACE_SHORT_GRASS < 2 && defined SHADER_GRASS
// darken the top of grass blocks a bit
@@ -485,6 +462,41 @@ void main() {
if(LIGHTNING > 0) Albedo = vec4(1);
float torchlightmap = lmcoord.x;
#if defined Hand_Held_lights && !defined LPV_ENABLED
#ifdef IS_IRIS
vec3 playerCamPos = cameraPosition - relativeEyePosition;
#else
vec3 playerCamPos = cameraPosition;
#endif
#ifdef VIVECRAFT
if (vivecraftIsVR) {
playerCamPos = cameraPosition - vivecraftRelativeMainHandPos;
}
#endif
float HELD_ITEM_BRIGHTNESS = 0.0;
if(heldItemId > 999 || heldItemId2 > 999 ) HELD_ITEM_BRIGHTNESS = 0.9;
// if(HELD_ITEM_BRIGHTNESS > 0.0) torchlightmap = max(torchlightmap, HELD_ITEM_BRIGHTNESS * clamp( pow(max(1.0-length(worldpos-playerCamPos)/HANDHELD_LIGHT_RANGE,0.0),1.5),0.0,1.0));
if(HELD_ITEM_BRIGHTNESS > 0.0){
float pointLight = clamp(1.0-(length(worldpos-playerCamPos)-1.)/HANDHELD_LIGHT_RANGE,0.0,1.0);
if (torchlightmap < 0.99) {
torchlightmap = mix(torchlightmap, HELD_ITEM_BRIGHTNESS, pointLight);
}
}
#ifdef HAND
torchlightmap *= 0.9;
#endif
#endif
float lightmap = clamp( (lmcoord.y-0.9) * 10.0,0.,1.);
#if defined WORLD && !defined ENTITIES && !defined HAND
float endPortalEmission = 0.0;
if(PORTAL > 0) {
@@ -593,6 +605,10 @@ void main() {
gl_FragData[3] = vec4(0.0);
#endif
#ifdef COLORWHEEL
Albedo.a = 0.4;
#endif
//////////////////////////////// ////////////////////////////////
//////////////////////////////// NORMAL ////////////////////////////////
@@ -672,17 +688,21 @@ void main() {
#endif
// hit glow effect...
#ifdef ENTITIES
#if defined ENTITIES && !defined COLORWHEEL
Albedo.rgb = mix(Albedo.rgb, entityColor.rgb, clamp(entityColor.a*1.5,0,1));
#endif
#ifdef COLORWHEEL
Albedo.rgb = mix(Albedo.rgb, overlayColor.rgb, clamp(overlayColor.a*1.5,0,1));
#endif
//////////////////////////////// ////////////////////////////////
//////////////////////////////// FINALIZE ////////////////////////////////
//////////////////////////////// ////////////////////////////////
#ifdef WORLD
// apply noise to lightmaps to reduce banding.
vec2 PackLightmaps = vec2(torchlightmap, lmtexcoord.w);
vec2 PackLightmaps = vec2(torchlightmap, lmcoord.y);
normal = viewToWorld(normal);
+5 -1
View File
@@ -187,11 +187,15 @@ void main() {
PORTAL = vPORTAL[i];
SIGN = vSIGN[i];
#ifdef COLORWHEEL
clrwl_setVertexOut(i);
#endif
EmitVertex();
}
EndPrimitive();
#if !defined ENTITIES && !defined HAND && defined SHADER_GRASS
#if !defined ENTITIES && !defined HAND && defined SHADER_GRASS && !defined COLORWHEEL
int j;
+31 -9
View File
@@ -1,3 +1,14 @@
#ifdef IS_LPV_ENABLED
#extension GL_EXT_shader_image_load_store: enable
#extension GL_ARB_shading_language_packing: enable
#endif
#if defined CUMULONIMBUS_LIGHTNING && CUMULONIMBUS > 0 && defined OVERWORLD_SHADER && defined COLORWHEEL
#extension GL_NV_gpu_shader5 : enable
#extension GL_ARB_shader_image_load_store : enable
#extension GL_EXT_shader_image_load_store : enable
#endif
#include "/lib/settings.glsl"
#if defined CUSTOM_MOON_ROTATION || defined END_ISLAND_LIGHT || WATER_INTERACTION == 2
@@ -10,11 +21,6 @@
// #undef IS_LPV_ENABLED
// #endif
#ifdef IS_LPV_ENABLED
#extension GL_EXT_shader_image_load_store: enable
#extension GL_ARB_shading_language_packing: enable
#endif
#include "/lib/res_params.glsl"
varying vec4 lmtexcoord;
@@ -509,7 +515,20 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
/////////////////////////////////// ALBEDO /////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
vec2 lightmap = lmtexcoord.zw;
#ifndef COLORWHEEL
gl_FragData[0] = texture2D(texture, lmtexcoord.xy, Texture_MipMap_Bias) * color;
#else
vec4 _color = texture2D(texture, lmtexcoord.xy, Texture_MipMap_Bias);
float ao;
vec4 overlayColor;
clrwl_computeFragment(_color, _color, lightmap, ao, overlayColor);
lightmap = clamp((lightmap - 1.0 / 32.0) * 32.0 / 30.0, 0.0, 1.0);
gl_FragData[0] = _color;
#endif
float UnchangedAlpha = gl_FragData[0].a;
@@ -551,10 +570,14 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
}
#endif
#ifdef ENTITIES
#if defined ENTITIES && !defined COLORWHEEL
Albedo.rgb = mix(Albedo.rgb, entityColor.rgb, clamp(entityColor.a*1.5,0,1));
#endif
#ifdef COLORWHEEL
Albedo.rgb = mix(Albedo.rgb, overlayColor.rgb, clamp(overlayColor.a*1.5,0,1));
#endif
vec4 GLASS_TINT_COLORS = vec4(Albedo, UnchangedAlpha);
#ifdef BIOME_TINT_WATER
@@ -609,7 +632,6 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
vec3 rippleBump = vec3(0.0);
vec2 lightmap = lmtexcoord.zw;
#if !defined HAND && !defined Vanilla_like_water
if (isWater){
vec3 playerPos = shadowPlayerPos;
@@ -960,7 +982,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
gl_FragData[0].rgb = FinalColor*0.1;
#endif
#if defined ENTITIES
#if defined ENTITIES && !defined COLORWHEEL
// do not allow specular to be very visible in these regions on entities
// this helps with specular on slimes, and entities with skin overlays like piglins/players
if (!gl_FrontFacing) {
@@ -1001,7 +1023,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
gl_FragData[3] = vec4(encodeVec2(lightmap.x, lightmap.y), 1, 1, 1);
#if defined ENTITIES && defined IS_IRIS
#if defined ENTITIES && defined IS_IRIS && !defined COLORWHEEL
if(NAMETAG > 0) {
// WHY DO THEY HAVE TO AHVE LIGHTING AAAAAAUGHAUHGUAHG
#ifndef OVERWORLD_SHADER
+21 -43
View File
@@ -4,45 +4,12 @@ varying vec4 color;
varying vec2 texcoord;
uniform sampler2D texture;
uniform sampler2D normals;
uniform sampler2D noisetex;
varying vec4 tangent;
varying vec4 normalMat;
uniform float frameTimeCounter;
//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));
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));
}
uniform mat4 gbufferModelViewInverse;
vec3 viewToWorld(vec3 viewPos) {
vec4 pos;
pos.xyz = viewPos;
pos.w = 0.0;
pos = gbufferModelViewInverse * pos;
return pos.xyz;
}
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
@@ -55,26 +22,37 @@ vec3 viewToWorld(vec3 viewPos) {
void main() {
vec4 Albedo = texture2D(texture, texcoord);
#ifndef COLORWHEEL
Albedo.rgb = toLinear(Albedo.rgb * color.rgb);
#else
vec2 lmcoord;
float ao;
vec4 overlayColor;
#if defined SPIDER_EYES || defined BEACON_BEAM || defined GLOWING
clrwl_computeFragment(Albedo, Albedo, lmcoord, ao, overlayColor);
if(Albedo.a < 0.102 || dot(Albedo.rgb, vec3(0.33333)) < 1.0/255.0) { discard; return; }
Albedo.rgb = mix(Albedo.rgb, overlayColor.rgb, overlayColor.a);
float minimumBrightness = 0.5;
#ifdef BEACON_BEAM
minimumBrightness = 10.0;
Albedo.rgb = toLinear(Albedo.rgb);
#endif
#if defined BEACON_BEAM
gl_FragData[0] = vec4(Albedo.rgb*Albedo.rgb * 0.1 * 5.0 * Emissive_Brightness, Albedo.a*color.a);
#endif
#if defined SPIDER_EYES || defined GLOWING
if(Albedo.a < 1.0/255.0 || dot(Albedo.rgb, vec3(0.33333)) < 1.0/255.0) { discard; return; }
#ifdef DISABLE_VANILLA_EMISSIVES
vec3 emissiveColor = vec3(0.0);
Albedo.a = 0.0;
#else
vec3 emissiveColor = Albedo.rgb * color.a ;//* autoBrightnessAdjust;
vec3 emissiveColor = Albedo.rgb * Albedo.a * Emissive_Brightness;
#endif
gl_FragData[0] = vec4(emissiveColor*0.1, Albedo.a * sqrt(color.a));
gl_FragData[0] = vec4(emissiveColor*0.1, 0.000001);
#endif
#ifdef ENCHANT_GLINT
@@ -85,9 +63,9 @@ void main() {
vec3 GlintColor = vec3(0.0);
Albedo.a = 0.0;
#else
vec3 GlintColor = Albedo.rgb * Emissive_Brightness;
vec3 GlintColor = Albedo.rgb * 0.2 * Emissive_Brightness;
#endif
gl_FragData[0] = vec4(GlintColor*0.1, dot(Albedo.rgb,vec3(0.333)) * Albedo.a );
gl_FragData[0] = vec4(GlintColor*0.1, 0.000001);
#endif
}
+1 -1
View File
@@ -1,6 +1,6 @@
option.SHADER_VERSION_LABEL = §d§lECLIPSE§r - A Bliss Edit
prefix.SHADER_VERSION_LABEL = V
value.SHADER_VERSION_LABEL.482 = 4.0.3
value.SHADER_VERSION_LABEL.482 = 4.1.0
# if you're here to translate, this is not a joke, these do what they say
profile.POTATO=§4Potato
+2 -5
View File
@@ -35,7 +35,7 @@ vec2 R2_Sample(int n){
return fract(alpha * n);
}
float fma(float a,float b,float c){
float fma2(float a,float b,float c){
return a * b + c;
}
@@ -52,7 +52,7 @@ vec3 SampleVNDFGGX(
const float tau = 6.2831853; // 2 * pi
float phi = tau * xy.x;
float cosTheta = fma(1.0 - xy.y, 1.0 + viewerDirection.z, -viewerDirection.z);
float cosTheta = fma2(1.0 - xy.y, 1.0 + viewerDirection.z, -viewerDirection.z);
float sinTheta = sqrt(clamp(1.0 - cosTheta * cosTheta, 0.0, 1.0));
sinTheta = clamp(sinTheta,0.0,1.0);
@@ -116,9 +116,6 @@ float shlickFresnelRoughness(float XdotN, float roughness){
// return vec2(clamp(u, 0.0, 1.0), clamp(v, 0.0, 1.0));
//}
//
//#extension GL_NV_gpu_shader5 : enable
//#extension GL_ARB_shader_image_load_store : enable
//#extension GL_EXT_shader_image_load_store : enable
//
//layout (rgba32f) uniform image2D reflectionSphere;
//
+2
View File
@@ -34,9 +34,11 @@ float lightningFlash = mix(0.1, 2.5, randomSeed);
#endif
#if defined CUMULONIMBUS_LIGHTNING && CUMULONIMBUS > 0
#ifndef COLORWHEEL
#extension GL_NV_gpu_shader5 : enable
#extension GL_ARB_shader_image_load_store : enable
#extension GL_EXT_shader_image_load_store : enable
#endif
layout (rgba16f) uniform image2D cloudDepthTex;
+15 -4
View File
@@ -18,10 +18,21 @@ void PopulateShadowVoxel(const in vec3 playerPos) {
vec3 originPos = playerPos;
if (
#ifdef COLORWHEEL
renderStage == CLRWL_RENDER_STAGE_SOLID || renderStage == CLRWL_RENDER_STAGE_TRANSLUCENT
#else
renderStage == MC_RENDER_STAGE_TERRAIN_SOLID || renderStage == MC_RENDER_STAGE_TERRAIN_TRANSLUCENT ||
renderStage == MC_RENDER_STAGE_TERRAIN_CUTOUT || renderStage == MC_RENDER_STAGE_TERRAIN_CUTOUT_MIPPED
) {
voxelId = uint(mc_Entity.x + 0.5);
#endif
)
{
float blockID = mc_Entity.x;
#ifdef COLORWHEEL
if(mc_Entity.x < 0.0) blockID = blockEntityId;
#endif
voxelId = uint(blockID + 0.5);
#ifdef IRIS_FEATURE_BLOCK_EMISSION_ATTRIBUTE
if (voxelId == 0u && at_midBlock.w > 0) voxelId = uint(BLOCK_LIGHT_1 + at_midBlock.w - 1);
@@ -38,7 +49,7 @@ void PopulateShadowVoxel(const in vec3 playerPos) {
ivec3 voxelPos = GetVoxelIndex(originPos);
#endif
#ifdef LPV_ENTITY_LIGHTS
#if defined LPV_ENTITY_LIGHTS && !defined COLORWHEEL
if (
((renderStage == MC_RENDER_STAGE_ENTITIES && (currentRenderedItemId > 0 || entityId > 0)) || renderStage == MC_RENDER_STAGE_BLOCK_ENTITIES)
) {
@@ -70,7 +81,7 @@ void PopulateShadowVoxel(const in vec3 playerPos) {
}
#endif
#if WATER_INTERACTION == 2
#if WATER_INTERACTION == 2 && !defined COLORWHEEL
if (
((renderStage == MC_RENDER_STAGE_ENTITIES && (currentRenderedItemId > 0 || entityId > 0)) || renderStage == MC_RENDER_STAGE_BLOCK_ENTITIES)
) {
+1 -1
View File
@@ -267,7 +267,7 @@ SHADER_VERSION_LABEL <profile> \
### RESOURCE PACK SUPPORT
screen.Resource_Pack_Support.columns = 1
screen.Resource_Pack_Support = [SPECULAR] [Emissives] [Subsurface_Scattering] [POM] [Refraction] MATERIAL_AO <empty RESOURCEPACK_SKY NORMAL_MAP_MULT
screen.Resource_Pack_Support = [SPECULAR] [Emissives] [Subsurface_Scattering] [POM] [Refraction] MATERIAL_AO <empty> RESOURCEPACK_SKY NORMAL_MAP_MULT
screen.SPECULAR.columns=1
screen.SPECULAR = \
+11
View File
@@ -0,0 +1,11 @@
#version 430 compatibility
#define NETHER_SHADER
#define WORLD
#define COLORWHEEL
#define ENTITIES
#define BLOCKENTITIES
#include "/dimensions/all_solid.fsh"
+11
View File
@@ -0,0 +1,11 @@
#version 430 compatibility
#define NETHER_SHADER
#define WORLD
#define COLORWHEEL
#define ENTITIES
#define BLOCKENTITIES
#include "/dimensions/all_solid.gsh"
+12
View File
@@ -0,0 +1,12 @@
#version 430 compatibility
#define NETHER_SHADER
#define WORLD
#define COLORWHEEL
#define ENTITIES
#define BLOCKENTITIES
#include "/dimensions/all_solid.vsh"
@@ -0,0 +1,9 @@
#version 430 compatibility
#define NETHER_SHADER
#define DAMAGE_BLOCK_EFFECT
#define COLORWHEEL
#include "/dimensions/all_particles.fsh"
@@ -0,0 +1,9 @@
#version 430 compatibility
#define NETHER_SHADER
#define DAMAGE_BLOCK_EFFECT
#define COLORWHEEL
#include "/dimensions/all_particles.vsh"
+9
View File
@@ -0,0 +1,9 @@
#version 430 compatibility
#define NETHER_SHADER
#define ENCHANT_GLINT
#define COLORWHEEL
#include "/dimensions/all_vanilla_emissives.fsh"
+9
View File
@@ -0,0 +1,9 @@
#version 430 compatibility
#define NETHER_SHADER
#define ENCHANT_GLINT
#define COLORWHEEL
#include "/dimensions/all_vanilla_emissives.vsh"
@@ -0,0 +1,12 @@
#version 430 compatibility
#define NETHER_SHADER
#define WORLD
#define COLORWHEEL
#define ENTITIES
#define BLOCKENTITIES
#include "/dimensions/all_translucent.fsh"
@@ -0,0 +1,11 @@
#version 430 compatibility
#define NETHER_SHADER
#define WORLD
#define COLORWHEEL
#define ENTITIES
#define BLOCKENTITIES
#include "/dimensions/all_translucent.vsh"
+12
View File
@@ -0,0 +1,12 @@
#version 430 compatibility
#include "/lib/settings.glsl"
#define COLORWHEEL
//////////////////////////////VOID MAIN//////////////////////////////
void main() {
gl_FragData[0] = vec4(0.0);
}
+60
View File
@@ -0,0 +1,60 @@
#version 430 compatibility
#if defined IS_LPV_ENABLED
#extension GL_ARB_explicit_attrib_location: enable
#extension GL_ARB_shader_image_load_store: enable
#endif
#define COLORWHEEL
#include "/lib/settings.glsl"
#define RENDER_SHADOW
/*
!! DO NOT REMOVE !!
This code is from Chocapic13' shaders
Read the terms of modification and sharing before changing something below please !
!! DO NOT REMOVE !!
*/
#ifdef IS_LPV_ENABLED
attribute vec4 mc_Entity;
#ifdef IRIS_FEATURE_BLOCK_EMISSION_ATTRIBUTE
attribute vec4 at_midBlock;
#else
attribute vec3 at_midBlock;
#endif
attribute vec3 vaPosition;
uniform mat4 shadowModelViewInverse;
uniform int renderStage;
uniform vec3 chunkOffset;
uniform vec3 cameraPosition;
uniform int currentRenderedItemId;
uniform int blockEntityId;
uniform int entityId;
#include "/lib/blocks.glsl"
#include "/lib/entities.glsl"
#include "/lib/voxel_common.glsl"
#include "/lib/voxel_write.glsl"
#endif
void main() {
#if defined IS_LPV_ENABLED && defined MC_GL_EXT_shader_image_load_store
#ifdef LPV_NOSHADOW_HACK
vec3 playerpos = gl_Vertex.xyz;
#else
vec3 position = mat3(gl_ModelViewMatrix) * vec3(gl_Vertex) + gl_ModelViewMatrix[3].xyz;
vec3 playerpos = mat3(shadowModelViewInverse) * position + shadowModelViewInverse[3].xyz;
#endif
PopulateShadowVoxel(playerpos);
#endif
gl_Position = vec4(-1.0);
}
+11
View File
@@ -0,0 +1,11 @@
#version 430 compatibility
#define OVERWORLD_SHADER
#define WORLD
#define COLORWHEEL
#define ENTITIES
#define BLOCKENTITIES
#include "/dimensions/all_solid.fsh"
+11
View File
@@ -0,0 +1,11 @@
#version 430 compatibility
#define OVERWORLD_SHADER
#define WORLD
#define COLORWHEEL
#define ENTITIES
#define BLOCKENTITIES
#include "/dimensions/all_solid.gsh"
+12
View File
@@ -0,0 +1,12 @@
#version 430 compatibility
#define OVERWORLD_SHADER
#define WORLD
#define COLORWHEEL
#define ENTITIES
#define BLOCKENTITIES
#include "/dimensions/all_solid.vsh"
@@ -0,0 +1,9 @@
#version 430 compatibility
#define OVERWORLD_SHADER
#define DAMAGE_BLOCK_EFFECT
#define COLORWHEEL
#include "/dimensions/all_particles.fsh"
@@ -0,0 +1,9 @@
#version 430 compatibility
#define OVERWORLD_SHADER
#define DAMAGE_BLOCK_EFFECT
#define COLORWHEEL
#include "/dimensions/all_particles.vsh"
+9
View File
@@ -0,0 +1,9 @@
#version 430 compatibility
#define OVERWORLD_SHADER
#define ENCHANT_GLINT
#define COLORWHEEL
#include "/dimensions/all_vanilla_emissives.fsh"
+9
View File
@@ -0,0 +1,9 @@
#version 430 compatibility
#define OVERWORLD_SHADER
#define ENCHANT_GLINT
#define COLORWHEEL
#include "/dimensions/all_vanilla_emissives.vsh"
@@ -0,0 +1,12 @@
#version 430 compatibility
#define OVERWORLD_SHADER
#define WORLD
#define COLORWHEEL
#define ENTITIES
#define BLOCKENTITIES
#include "/dimensions/all_translucent.fsh"
@@ -0,0 +1,11 @@
#version 430 compatibility
#define OVERWORLD_SHADER
#define WORLD
#define COLORWHEEL
#define ENTITIES
#define BLOCKENTITIES
#include "/dimensions/all_translucent.vsh"
+37
View File
@@ -0,0 +1,37 @@
#version 430 compatibility
#include "/lib/settings.glsl"
varying vec4 color;
varying vec2 texcoord;
uniform sampler2D tex;
uniform sampler2D noisetex;
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
float blueNoise(){
return fract(texelFetch2D(noisetex, ivec2(gl_FragCoord.xy)%512, 0).a + 1.0/1.6180339887 );
}
/* RENDERTARGETS: 0 */
void main() {
vec4 color = texture2D(tex,texcoord.xy);
vec2 lmcoord;
float ao;
vec4 overlayColor;
clrwl_computeFragment(color, color, lmcoord, ao, overlayColor);
color.rgb = mix(color.rgb, overlayColor.rgb, overlayColor.a);
gl_FragData[0] = color;
#ifdef Stochastic_Transparent_Shadows
if(gl_FragData[0].a < blueNoise()) { discard; return;}
#endif
}
+296
View File
@@ -0,0 +1,296 @@
#version 430 compatibility
#if defined IS_LPV_ENABLED
#extension GL_ARB_explicit_attrib_location: enable
#extension GL_ARB_shader_image_load_store: enable
#endif
#define RENDER_SHADOW
#define COLORWHEEL
#include "/lib/SSBOs.glsl"
#include "/lib/settings.glsl"
/*
!! DO NOT REMOVE !!
This code is from Chocapic13' shaders
Read the terms of modification and sharing before changing something below please !
!! DO NOT REMOVE !!
*/
#define SHADOW_MAP_BIAS 0.5
const float PI = 3.1415927;
varying vec2 texcoord;
uniform mat4 shadowProjectionInverse;
uniform mat4 shadowProjection;
uniform mat4 shadowModelViewInverse;
uniform mat4 shadowModelView;
uniform mat4 gbufferModelView;
uniform mat4 gbufferModelViewInverse;
uniform mat4 gbufferProjection;
uniform mat4 gbufferProjectionInverse;
uniform int hideGUI;
uniform vec3 cameraPosition;
uniform vec3 relativeEyePosition;
uniform float frameTimeCounter;
uniform int frameCounter;
uniform float screenBrightness;
uniform vec3 sunVec;
uniform float aspectRatio;
uniform float sunElevation;
uniform vec3 sunPosition;
uniform float lightSign;
uniform float cosFov;
uniform vec3 shadowViewDir;
uniform vec3 shadowCamera;
uniform vec3 shadowLightVec;
uniform float shadowMaxProj;
attribute vec4 mc_midTexCoord;
varying vec4 color;
varying vec3 vertexPos;
attribute vec4 mc_Entity;
uniform int blockEntityId;
uniform int entityId;
#include "/lib/Shadow_Params.glsl"
#include "/lib/bokeh.glsl"
#include "/lib/blocks.glsl"
#include "/lib/entities.glsl"
#if defined IS_LPV_ENABLED
#ifdef IRIS_FEATURE_BLOCK_EMISSION_ATTRIBUTE
attribute vec4 at_midBlock;
#else
attribute vec3 at_midBlock;
#endif
uniform int currentRenderedItemId;
uniform int renderStage;
#include "/lib/voxel_common.glsl"
#include "/lib/voxel_write.glsl"
#endif
const float PI48 = 150.796447372*WAVY_SPEED;
float pi2wt = PI48*frameTimeCounter;
out float LIGHTNING;
vec2 calcWave(in vec3 pos) {
float magnitude = abs(sin(dot(vec4(frameTimeCounter, pos),vec4(1.0,0.005,0.005,0.005)))*0.5+0.72)*0.013;
vec2 ret = (sin(pi2wt*vec2(0.0063,0.0015)*4. - pos.xz + pos.y*0.05)+0.1)*magnitude;
return ret;
}
vec3 calcMovePlants(in vec3 pos) {
vec2 move1 = calcWave(pos );
float move1y = -length(move1);
return vec3(move1.x,move1y,move1.y)*5.*WAVY_STRENGTH/255.0;
}
vec3 calcWaveLeaves(in vec3 pos, in float fm, in float mm, in float ma, in float f0, in float f1, in float f2, in float f3, in float f4, in float f5) {
float magnitude = abs(sin(dot(vec4(frameTimeCounter, pos),vec4(1.0,0.005,0.005,0.005)))*0.5+0.72)*0.013;
vec3 ret = (sin(pi2wt*vec3(0.0063,0.0224,0.0015)*1.5 - pos))*magnitude;
return ret;
}
vec3 calcMoveLeaves(in vec3 pos, in float f0, in float f1, in float f2, in float f3, in float f4, in float f5, in vec3 amp1, in vec3 amp2) {
vec3 move1 = calcWaveLeaves(pos , 0.0054, 0.0400, 0.0400, 0.0127, 0.0089, 0.0114, 0.0063, 0.0224, 0.0015) * amp1;
return move1*5.*WAVY_STRENGTH/255.;
}
bool intersectCone(float coneHalfAngle, vec3 coneTip , vec3 coneAxis, vec3 rayOrig, vec3 rayDir, float maxZ)
{
vec3 co = rayOrig - coneTip;
float prod = dot(normalize(co),coneAxis);
if (prod <= -coneHalfAngle) return true; //In view frustrum
float a = dot(rayDir,coneAxis)*dot(rayDir,coneAxis) - coneHalfAngle*coneHalfAngle;
float b = 2. * (dot(rayDir,coneAxis)*dot(co,coneAxis) - dot(rayDir,co)*coneHalfAngle*coneHalfAngle);
float c = dot(co,coneAxis)*dot(co,coneAxis) - dot(co,co)*coneHalfAngle*coneHalfAngle;
float det = b*b - 4.*a*c;
if (det < 0.) return false; // No intersection with either forward cone and backward cone
det = sqrt(det);
float t2 = (-b + det) / (2. * a);
if (t2 <= 0.0 || t2 >= maxZ) return false; //Idk why it works
return true;
}
#define diagonal3(m) vec3((m)[0].x, (m)[1].y, m[2].z)
#define projMAD(m, v) (diagonal3(m) * (v) + (m)[3].xyz)
// uniform float far;
uniform float dhFarPlane;
#include "/lib/DistantHorizons_projections.glsl"
vec4 toClipSpace3(vec3 viewSpacePosition) {
// mat4 projection = DH_shadowProjectionTweak(gl_ProjectionMatrix);
return vec4(projMAD(gl_ProjectionMatrix, viewSpacePosition),1.0);
}
vec3 viewToWorld(vec3 viewPos) {
vec4 pos;
pos.xyz = viewPos;
pos.w = 0.0;
pos = shadowModelViewInverse * pos;
return pos.xyz;
}
varying vec3 playerpos;
// uniform int renderStage;
// uniform mat4 gbufferModelViewInverse;
void main() {
texcoord.xy = gl_MultiTexCoord0.xy;
color = gl_Color;
vec3 position = mat3(gl_ModelViewMatrix) * vec3(gl_Vertex) + gl_ModelViewMatrix[3].xyz;
// playerpos = vec4(0.0);
// playerpos = gbufferModelViewInverse * (gl_ModelViewMatrix * gl_Vertex);
// mat4 Custom_ViewMatrix = BuildShadowViewMatrix(LightDir);
// mat4 Custom_ProjectionMatrix = BuildShadowProjectionMatrix();
// position = gl_Vertex.xyz;
// if((renderStage == 10 || renderStage == 12) && mc_Entity.x != 3000) {
// position = (shadowModelViewInverse * vec4(gl_Vertex.xyz,1.0)).xyz;
// }
// position = mat3(Custom_ViewMatrix) * position + Custom_ViewMatrix[3].xyz;
// HHHHHHHHH ITS THE JITTER DOF HERE TO SAY HELLO
// It turns out 'position' above is just viewPos lmao
// #ifdef DOF_JITTER_SHADOW
// // CLIP SPACE
// vec2 jitter = clamp(jitter_offsets[frameCounter % 64], -1.0, 1.0);
// jitter = rotate(radians(float(frameCounter))) * jitter;
// jitter.y *= aspectRatio;
// jitter.x *= DOF_ANAMORPHIC_RATIO;
// vec4 clipPos = gbufferProjection * vec4(position, 1.0);
// // CLIP SPACE -> VIEW SPACE
// vec3 viewPos = (gbufferProjectionInverse * clipPos).xyz;
// // Focus distance
// #if DOF_JITTER_FOCUS < 0
// float focusMul = clipPos.z - mix(pow(512.0, screenBrightness), 512.0 * screenBrightness, 0.25);
// #else
// float focusMul = clipPos.z - DOF_JITTER_FOCUS;
// #endif
// // CLIP SPACE -> SHADOW CLIP SPACE
// vec3 jitterViewPos = (gbufferProjectionInverse * vec4(jitter, 1.0, 1.0)).xyz;
// // vec3 jitterFeetPos = (gbufferModelViewInverse * vec4(jitterViewPos, 1.0)).xyz;
// // vec3 jitterShadowViewPos = (shadowModelView * vec4(jitterFeetPos, 1.0)).xyz;
// // vec4 jitterShadowClipPos = gl_ProjectionMatrix * vec4(jitterShadowViewPos, 1.0);
// // vec4 totalOffset = jitterShadowClipPos * JITTER_STRENGTH * focusMul * 1e-2;
// position += jitterViewPos * focusMul * 1e-2;
// if(focusMul < 10.0) {
// gl_Position = vec4(-1.0);
// return;
// }
// #endif
// #if defined IS_LPV_ENABLED || defined WAVY_PLANTS || !defined PLANET_CURVATURE
playerpos = mat3(shadowModelViewInverse) * position + shadowModelViewInverse[3].xyz;
// #endif
#if defined IS_LPV_ENABLED && defined MC_GL_EXT_shader_image_load_store
PopulateShadowVoxel(playerpos);
#endif
// #ifdef WAVY_PLANTS
// bool istopv = gl_MultiTexCoord0.t < mc_midTexCoord.t;
// if (
// (
// blockId == BLOCK_GROUND_WAVING || blockId == BLOCK_GROUND_WAVING_VERTICAL ||
// blockId == BLOCK_GRASS_SHORT || (blockId == BLOCK_GRASS_TALL_UPPER && istopv) ||
// blockId == BLOCK_SAPLING
// ) && length(position.xy) < 24.0
// ) {
// playerpos += calcMovePlants(playerpos + cameraPosition)*gl_MultiTexCoord1.y;
// position = mat3(shadowModelView) * playerpos + shadowModelView[3].xyz;
// }
// if (blockId == BLOCK_AIR_WAVING && length(position.xy) < 24.0) {
// playerpos += calcMoveLeaves(playerpos + cameraPosition, 0.0040, 0.0064, 0.0043, 0.0035, 0.0037, 0.0041, vec3(1.0,0.2,1.0), vec3(0.5,0.1,0.5))*gl_MultiTexCoord1.y;
// position = mat3(shadowModelView) * playerpos + shadowModelView[3].xyz;
// }
// #endif
int blockId = int(mc_Entity.x + 0.5);
vec3 worldpos = playerpos;
#ifdef WAVY_PLANTS
// also use normal, so up/down facing geometry does not get detatched from its model parts.
bool InterpolateFromBase = gl_MultiTexCoord0.t < max(mc_midTexCoord.t, abs(viewToWorld(normalize(gl_NormalMatrix * gl_Normal)).y));
if(
(
// these wave off of the ground. the area connected to the ground does not wave.
(InterpolateFromBase && (blockId == BLOCK_GRASS_TALL_LOWER || blockId == BLOCK_GROUND_WAVING || blockId == BLOCK_GRASS_SHORT || blockId == BLOCK_SAPLING || blockId == BLOCK_GROUND_WAVING_VERTICAL))
// these wave off of the ceiling. the area connected to the ceiling does not wave.
|| (!InterpolateFromBase && (blockId == BLOCK_VINE_OTHER))
// these wave off of the air. they wave uniformly
|| (blockId == BLOCK_GRASS_TALL_UPPER || blockId == BLOCK_AIR_WAVING)
) && length(position.xy) < 24.0
){
// apply displacement for waving plant blocks
worldpos += calcMovePlants(playerpos + cameraPosition) * max(gl_MultiTexCoord1.y,0.5);
// apply displacement for waving leaf blocks specifically, overwriting the other waving mode. these wave off of the air. they wave uniformly
if(blockId == BLOCK_AIR_WAVING) worldpos = playerpos + calcMoveLeaves(playerpos + cameraPosition, 0.0040, 0.0064, 0.0043, 0.0035, 0.0037, 0.0041, vec3(1.0,0.2,1.0), vec3(0.5,0.1,0.5))*gl_MultiTexCoord1.y;
}
#endif
LIGHTNING = 0.0;
if (entityId == ENTITY_LIGHTNING) LIGHTNING = 1.0;
#ifdef PLANET_CURVATURE
float curvature = length(worldpos) / (16*8);
worldpos.y -= curvature*curvature * CURVATURE_AMOUNT;
#endif
#ifdef CUSTOM_MOON_ROTATION
position = mat3(customShadowMatrixSSBO) * worldpos + customShadowMatrixSSBO[3].xyz;
#else
position = mat3(shadowModelView) * worldpos + shadowModelView[3].xyz;
#endif
#ifdef DISTORT_SHADOWMAP
if (entityId == ENTITY_SSS_MEDIUM || entityId == ENTITY_SLIME)
position.xyz = position.xyz - normalize(gl_NormalMatrix * gl_Normal) * 0.25;
gl_Position = BiasShadowProjection(toClipSpace3(position));
#else
gl_Position = toClipSpace3(position);
#endif
if (blockId == BLOCK_WATER) gl_Position.w = -1.0;
gl_Position.z /= 6.0;
}
+6 -6
View File
@@ -21,16 +21,16 @@ uniform sampler2D noisetex;
in float LIGHTNING;
uniform float frameTimeCounter;
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
float blueNoise(){
return fract(texelFetch2D(noisetex, ivec2(gl_FragCoord.xy)%512, 0).a + 1.0/1.6180339887 );
}
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
void main() {
if (LIGHTNING > 0.0) discard;
+11
View File
@@ -0,0 +1,11 @@
#version 430 compatibility
#define END_SHADER
#define WORLD
#define COLORWHEEL
#define ENTITIES
#define BLOCKENTITIES
#include "/dimensions/all_solid.fsh"
+11
View File
@@ -0,0 +1,11 @@
#version 430 compatibility
#define END_SHADER
#define WORLD
#define COLORWHEEL
#define ENTITIES
#define BLOCKENTITIES
#include "/dimensions/all_solid.gsh"
+12
View File
@@ -0,0 +1,12 @@
#version 430 compatibility
#define END_SHADER
#define WORLD
#define COLORWHEEL
#define ENTITIES
#define BLOCKENTITIES
#include "/dimensions/all_solid.vsh"
@@ -0,0 +1,9 @@
#version 430 compatibility
#define END_SHADER
#define DAMAGE_BLOCK_EFFECT
#define COLORWHEEL
#include "/dimensions/all_particles.fsh"
@@ -0,0 +1,9 @@
#version 430 compatibility
#define END_SHADER
#define DAMAGE_BLOCK_EFFECT
#define COLORWHEEL
#include "/dimensions/all_particles.vsh"
+9
View File
@@ -0,0 +1,9 @@
#version 430 compatibility
#define END_SHADER
#define ENCHANT_GLINT
#define COLORWHEEL
#include "/dimensions/all_vanilla_emissives.fsh"
+9
View File
@@ -0,0 +1,9 @@
#version 430 compatibility
#define END_SHADER
#define ENCHANT_GLINT
#define COLORWHEEL
#include "/dimensions/all_vanilla_emissives.vsh"
@@ -0,0 +1,12 @@
#version 430 compatibility
#define END_SHADER
#define WORLD
#define COLORWHEEL
#define ENTITIES
#define BLOCKENTITIES
#include "/dimensions/all_translucent.fsh"
@@ -0,0 +1,11 @@
#version 430 compatibility
#define END_SHADER
#define WORLD
#define COLORWHEEL
#define ENTITIES
#define BLOCKENTITIES
#include "/dimensions/all_translucent.vsh"
+54
View File
@@ -0,0 +1,54 @@
#version 430 compatibility
#include "/lib/settings.glsl"
#define COLORWHEEL
varying vec4 color;
varying vec2 texcoord;
uniform sampler2D tex;
uniform sampler2D texture;
uniform sampler2D noisetex;
#if defined DISTANT_HORIZONS && DH_CHUNK_FADING > 1
uniform float far;
#endif
varying float LIGHTNING;
uniform float frameTimeCounter;
//////////////////////////////VOID MAIN//////////////////////////////
float blueNoise(){
return fract(texelFetch2D(noisetex, ivec2(gl_FragCoord.xy)%512, 0).a + 1.0/1.6180339887 );
}
void main() {
#ifdef END_ISLAND_LIGHT
if (LIGHTNING > 0.0) discard;
vec4 color = texture2D(tex,texcoord.xy);
vec2 lmcoord;
float ao;
vec4 overlayColor;
clrwl_computeFragment(color, color, lmcoord, ao, overlayColor);
color.rgb = mix(color.rgb, overlayColor.rgb, overlayColor.a);
gl_FragData[0] = color;
// gl_FragData[0] = vec4(texture2D(tex,texcoord.xy).rgb * color.rgb, texture2DLod(tex, texcoord.xy, 0).a);
#ifdef Stochastic_Transparent_Shadows
if(gl_FragData[0].a < blueNoise()) { discard; return;}
#endif
#else
gl_FragData[0] = vec4(0.0);
#endif
}
+93
View File
@@ -0,0 +1,93 @@
#version 430 compatibility
#if defined IS_LPV_ENABLED
#extension GL_ARB_explicit_attrib_location: enable
#extension GL_ARB_shader_image_load_store: enable
#endif
#define COLORWHEEL
#include "/lib/SSBOs.glsl"
#include "/lib/settings.glsl"
#define RENDER_SHADOW
/*
!! DO NOT REMOVE !!
This code is from Chocapic13' shaders
Read the terms of modification and sharing before changing something below please !
!! DO NOT REMOVE !!
*/
#if defined IS_LPV_ENABLED || defined END_ISLAND_LIGHT
uniform int renderStage;
uniform mat4 shadowModelViewInverse;
uniform int entityId;
#include "/lib/entities.glsl"
#endif
#if defined IS_LPV_ENABLED
attribute vec4 mc_Entity;
#ifdef IRIS_FEATURE_BLOCK_EMISSION_ATTRIBUTE
attribute vec4 at_midBlock;
#else
attribute vec3 at_midBlock;
#endif
attribute vec3 vaPosition;
uniform vec3 chunkOffset;
uniform vec3 cameraPosition;
uniform vec3 relativeEyePosition;
uniform int currentRenderedItemId;
uniform int blockEntityId;
#include "/lib/blocks.glsl"
#include "/lib/voxel_common.glsl"
#include "/lib/voxel_write.glsl"
#endif
varying float LIGHTNING;
// out float entity;
varying vec4 color;
varying vec2 texcoord;
//#include "/lib/Shadow_Params.glsl"
// uniform int entityId;
void main() {
#if defined END_ISLAND_LIGHT || (defined IS_LPV_ENABLED && defined MC_GL_EXT_shader_image_load_store)
vec3 shadowViewPos = mat3(gl_ModelViewMatrix) * vec3(gl_Vertex) + gl_ModelViewMatrix[3].xyz;
vec3 feetPlayerPos = mat3(shadowModelViewInverse) * shadowViewPos + shadowModelViewInverse[3].xyz;
#endif
#if defined IS_LPV_ENABLED && defined MC_GL_EXT_shader_image_load_store
#ifdef LPV_NOSHADOW_HACK
vec3 playerpos = gl_Vertex.xyz;
#else
vec3 playerpos = feetPlayerPos;
#endif
PopulateShadowVoxel(playerpos);
#endif
#ifdef END_ISLAND_LIGHT
texcoord.xy = gl_MultiTexCoord0.xy;
color = gl_Color;
// hide lightning and dragon death beams
vec3 normal = normalize(gl_NormalMatrix * gl_Normal);
LIGHTNING = 0.0;
if (renderStage == MC_RENDER_STAGE_ENTITIES && (entityId == ENTITY_LIGHTNING || (entityId == 0 && gl_Color.a < 0.2 && abs(normal.y) < 0.2))) LIGHTNING = 1.0;
gl_Position = customShadowPerspectiveSSBO * customShadowMatrixSSBO * vec4(feetPlayerPos, 1.0);
gl_Position.z /= 6.0;
#else
gl_Position = vec4(-1.0);
#endif
}