mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-01-03 16:13:30 +08:00
nether/end temp floodfill fix
This commit is contained in:
parent
7cd1cde2c3
commit
beac5d235f
@ -14,48 +14,18 @@ Read the terms of modification and sharing before changing something below pleas
|
|||||||
!! DO NOT REMOVE !!
|
!! 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 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;
|
|
||||||
|
|
||||||
#ifdef IS_LPV_ENABLED
|
#ifdef IS_LPV_ENABLED
|
||||||
attribute vec4 mc_Entity;
|
attribute vec4 mc_Entity;
|
||||||
attribute vec3 at_midBlock;
|
attribute vec3 at_midBlock;
|
||||||
|
attribute vec3 vaPosition;
|
||||||
|
|
||||||
uniform int renderStage;
|
uniform int renderStage;
|
||||||
|
uniform vec3 chunkOffset;
|
||||||
|
uniform vec3 cameraPosition;
|
||||||
uniform int currentRenderedItemId;
|
uniform int currentRenderedItemId;
|
||||||
uniform int blockEntityId;
|
uniform int blockEntityId;
|
||||||
uniform int entityId;
|
uniform int entityId;
|
||||||
|
|
||||||
// #include "/lib/Shadow_Params.glsl"
|
|
||||||
// #include "/lib/bokeh.glsl"
|
|
||||||
|
|
||||||
|
|
||||||
#include "/lib/blocks.glsl"
|
#include "/lib/blocks.glsl"
|
||||||
#include "/lib/entities.glsl"
|
#include "/lib/entities.glsl"
|
||||||
#include "/lib/voxel_common.glsl"
|
#include "/lib/voxel_common.glsl"
|
||||||
@ -65,57 +35,50 @@ uniform vec3 cameraPosition;
|
|||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
#if defined IS_LPV_ENABLED && defined MC_GL_EXT_shader_image_load_store
|
#if defined IS_LPV_ENABLED && defined MC_GL_EXT_shader_image_load_store
|
||||||
vec3 position = mat3(gl_ModelViewMatrix) * vec3(gl_Vertex) + gl_ModelViewMatrix[3].xyz;
|
|
||||||
|
|
||||||
int blockId = int(mc_Entity.x + 0.5);
|
|
||||||
|
|
||||||
#if defined IS_LPV_ENABLED || defined WAVY_PLANTS
|
|
||||||
vec3 playerpos = mat3(shadowModelViewInverse) * position + shadowModelViewInverse[3].xyz;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
renderStage == MC_RENDER_STAGE_TERRAIN_SOLID || renderStage == MC_RENDER_STAGE_TERRAIN_TRANSLUCENT ||
|
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
|
renderStage == MC_RENDER_STAGE_TERRAIN_CUTOUT || renderStage == MC_RENDER_STAGE_TERRAIN_CUTOUT_MIPPED
|
||||||
) {
|
) {
|
||||||
uint voxelId = uint(blockId);
|
vec3 playerpos = gl_Vertex.xyz;
|
||||||
if (voxelId == 0u) voxelId = 1u;
|
|
||||||
|
|
||||||
vec3 originPos = playerpos + at_midBlock/64.0;
|
vec3 originPos = playerpos + at_midBlock/64.0;
|
||||||
|
|
||||||
|
uint voxelId = uint(mc_Entity.x + 0.5);
|
||||||
|
if (voxelId == 0u) voxelId = 1u;
|
||||||
|
|
||||||
SetVoxelBlock(originPos, voxelId);
|
SetVoxelBlock(originPos, voxelId);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef LPV_ENTITY_LIGHTS
|
// #ifdef LPV_ENTITY_LIGHTS
|
||||||
if (
|
// if (
|
||||||
(currentRenderedItemId > 0 || entityId > 0) &&
|
// (currentRenderedItemId > 0 || entityId > 0) &&
|
||||||
(renderStage == MC_RENDER_STAGE_BLOCK_ENTITIES || renderStage == MC_RENDER_STAGE_ENTITIES)
|
// (renderStage == MC_RENDER_STAGE_BLOCK_ENTITIES || renderStage == MC_RENDER_STAGE_ENTITIES)
|
||||||
) {
|
// ) {
|
||||||
uint voxelId = 0u;
|
// uint voxelId = 0u;
|
||||||
|
|
||||||
if (currentRenderedItemId > 0) {
|
// if (currentRenderedItemId > 0) {
|
||||||
if (entityId == ENTITY_PLAYER) {
|
// if (entityId == ENTITY_PLAYER) {
|
||||||
// TODO: remove once hand-light is added
|
// // TODO: remove once hand-light is added
|
||||||
if (currentRenderedItemId < 1000)
|
// if (currentRenderedItemId < 1000)
|
||||||
voxelId = uint(currentRenderedItemId);
|
// voxelId = uint(currentRenderedItemId);
|
||||||
}
|
// }
|
||||||
else if (entityId != ENTITY_ITEM_FRAME)
|
// else if (entityId != ENTITY_ITEM_FRAME)
|
||||||
voxelId = uint(currentRenderedItemId);
|
// voxelId = uint(currentRenderedItemId);
|
||||||
}
|
// }
|
||||||
else {
|
// else {
|
||||||
switch (entityId) {
|
// switch (entityId) {
|
||||||
case ENTITY_SPECTRAL_ARROW:
|
// case ENTITY_SPECTRAL_ARROW:
|
||||||
voxelId = uint(BLOCK_TORCH);
|
// voxelId = uint(BLOCK_TORCH);
|
||||||
break;
|
// break;
|
||||||
|
|
||||||
// TODO: blaze, magma_cube
|
// // TODO: blaze, magma_cube
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (voxelId > 0u)
|
// if (voxelId > 0u)
|
||||||
SetVoxelBlock(playerpos, voxelId);
|
// SetVoxelBlock(playerpos, voxelId);
|
||||||
}
|
// }
|
||||||
#endif
|
// #endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gl_Position = vec4(-1.0);
|
gl_Position = vec4(-1.0);
|
||||||
}
|
}
|
||||||
|
@ -14,48 +14,18 @@ Read the terms of modification and sharing before changing something below pleas
|
|||||||
!! DO NOT REMOVE !!
|
!! 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 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;
|
|
||||||
|
|
||||||
#ifdef IS_LPV_ENABLED
|
#ifdef IS_LPV_ENABLED
|
||||||
attribute vec4 mc_Entity;
|
attribute vec4 mc_Entity;
|
||||||
attribute vec3 at_midBlock;
|
attribute vec3 at_midBlock;
|
||||||
|
attribute vec3 vaPosition;
|
||||||
|
|
||||||
uniform int renderStage;
|
uniform int renderStage;
|
||||||
|
uniform vec3 chunkOffset;
|
||||||
|
uniform vec3 cameraPosition;
|
||||||
uniform int currentRenderedItemId;
|
uniform int currentRenderedItemId;
|
||||||
uniform int blockEntityId;
|
uniform int blockEntityId;
|
||||||
uniform int entityId;
|
uniform int entityId;
|
||||||
|
|
||||||
// #include "/lib/Shadow_Params.glsl"
|
|
||||||
// #include "/lib/bokeh.glsl"
|
|
||||||
|
|
||||||
|
|
||||||
#include "/lib/blocks.glsl"
|
#include "/lib/blocks.glsl"
|
||||||
#include "/lib/entities.glsl"
|
#include "/lib/entities.glsl"
|
||||||
#include "/lib/voxel_common.glsl"
|
#include "/lib/voxel_common.glsl"
|
||||||
@ -65,57 +35,50 @@ uniform vec3 cameraPosition;
|
|||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
#if defined IS_LPV_ENABLED && defined MC_GL_EXT_shader_image_load_store
|
#if defined IS_LPV_ENABLED && defined MC_GL_EXT_shader_image_load_store
|
||||||
vec3 position = mat3(gl_ModelViewMatrix) * vec3(gl_Vertex) + gl_ModelViewMatrix[3].xyz;
|
|
||||||
|
|
||||||
int blockId = int(mc_Entity.x + 0.5);
|
|
||||||
|
|
||||||
#if defined IS_LPV_ENABLED || defined WAVY_PLANTS
|
|
||||||
vec3 playerpos = mat3(shadowModelViewInverse) * position + shadowModelViewInverse[3].xyz;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
renderStage == MC_RENDER_STAGE_TERRAIN_SOLID || renderStage == MC_RENDER_STAGE_TERRAIN_TRANSLUCENT ||
|
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
|
renderStage == MC_RENDER_STAGE_TERRAIN_CUTOUT || renderStage == MC_RENDER_STAGE_TERRAIN_CUTOUT_MIPPED
|
||||||
) {
|
) {
|
||||||
uint voxelId = uint(blockId);
|
vec3 playerpos = vaPosition + chunkOffset + gl_Vertex.xyz;
|
||||||
if (voxelId == 0u) voxelId = 1u;
|
|
||||||
|
|
||||||
vec3 originPos = playerpos + at_midBlock/64.0;
|
vec3 originPos = playerpos + at_midBlock/64.0;
|
||||||
|
|
||||||
|
uint voxelId = uint(mc_Entity.x + 0.5);
|
||||||
|
if (voxelId == 0u) voxelId = 1u;
|
||||||
|
|
||||||
SetVoxelBlock(originPos, voxelId);
|
SetVoxelBlock(originPos, voxelId);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef LPV_ENTITY_LIGHTS
|
// #ifdef LPV_ENTITY_LIGHTS
|
||||||
if (
|
// if (
|
||||||
(currentRenderedItemId > 0 || entityId > 0) &&
|
// (currentRenderedItemId > 0 || entityId > 0) &&
|
||||||
(renderStage == MC_RENDER_STAGE_BLOCK_ENTITIES || renderStage == MC_RENDER_STAGE_ENTITIES)
|
// (renderStage == MC_RENDER_STAGE_BLOCK_ENTITIES || renderStage == MC_RENDER_STAGE_ENTITIES)
|
||||||
) {
|
// ) {
|
||||||
uint voxelId = 0u;
|
// uint voxelId = 0u;
|
||||||
|
|
||||||
if (currentRenderedItemId > 0) {
|
// if (currentRenderedItemId > 0) {
|
||||||
if (entityId == ENTITY_PLAYER) {
|
// if (entityId == ENTITY_PLAYER) {
|
||||||
// TODO: remove once hand-light is added
|
// // TODO: remove once hand-light is added
|
||||||
if (currentRenderedItemId < 1000)
|
// if (currentRenderedItemId < 1000)
|
||||||
voxelId = uint(currentRenderedItemId);
|
// voxelId = uint(currentRenderedItemId);
|
||||||
}
|
// }
|
||||||
else if (entityId != ENTITY_ITEM_FRAME)
|
// else if (entityId != ENTITY_ITEM_FRAME)
|
||||||
voxelId = uint(currentRenderedItemId);
|
// voxelId = uint(currentRenderedItemId);
|
||||||
}
|
// }
|
||||||
else {
|
// else {
|
||||||
switch (entityId) {
|
// switch (entityId) {
|
||||||
case ENTITY_SPECTRAL_ARROW:
|
// case ENTITY_SPECTRAL_ARROW:
|
||||||
voxelId = uint(BLOCK_TORCH);
|
// voxelId = uint(BLOCK_TORCH);
|
||||||
break;
|
// break;
|
||||||
|
|
||||||
// TODO: blaze, magma_cube
|
// // TODO: blaze, magma_cube
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (voxelId > 0u)
|
// if (voxelId > 0u)
|
||||||
SetVoxelBlock(playerpos, voxelId);
|
// SetVoxelBlock(playerpos, voxelId);
|
||||||
}
|
// }
|
||||||
#endif
|
// #endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gl_Position = vec4(-1.0);
|
gl_Position = vec4(-1.0);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user