improve glow item frame rendering

This commit is contained in:
Merlin1809
2026-08-21 14:59:32 +02:00
parent 350ba41a82
commit 6d73d98640
12 changed files with 39 additions and 20 deletions
+2 -2
View File
@@ -496,7 +496,7 @@ void main() {
const vec3 lpvPos = vec3(0.0);
#endif
vec3 Indirect_lighting = doBlockLightLighting(vec3(TORCH_R,TORCH_G,TORCH_B), lightmap.x, feetPlayerPos, lpvPos, false);
vec3 Indirect_lighting = doBlockLightLighting(vec3(TORCH_R,TORCH_G,TORCH_B), lightmap.x, feetPlayerPos, lpvPos, false, false);
#ifdef FLASHLIGHT
vec4 flashLightSpecularData = vec4(0.0);
@@ -596,7 +596,7 @@ void main() {
const vec3 lpvPos = vec3(0.0);
#endif
Indirect_lighting += doBlockLightLighting( vec3(TORCH_R,TORCH_G,TORCH_B), lightmap.x, feetPlayerPos, lpvPos, true);
Indirect_lighting += doBlockLightLighting( vec3(TORCH_R,TORCH_G,TORCH_B), lightmap.x, feetPlayerPos, lpvPos, false, true);
#ifdef LINES
gl_FragData[0].rgb = (Indirect_lighting + Direct_lighting) * toLinear(color.rgb);
+5 -4
View File
@@ -442,7 +442,7 @@ void main() {
#ifdef ENTITIES
// disallow POM to work on item frames.
SIGN = data_in.blockID == ENTITY_ITEM_FRAME;
SIGN = data_in.blockID == ENTITY_ITEM_FRAME || data_in.blockID == ENTITY_GLOW_ITEM_FRAME;
#else
SIGN = data_in.blockID == BLOCK_SIGN;
#endif
@@ -550,6 +550,8 @@ void main() {
float opaqueMasks = 1.0;
vec2 lmcoord = data_in.lmtexcoord.zw;
#ifdef HAND
opaqueMasks = 0.75;
#else
@@ -559,7 +561,8 @@ void main() {
#endif
#if defined ENTITIES
opaqueMasks = 0.45;
if (data_in.blockID == ENTITY_GLOW_ITEM_FRAME) {opaqueMasks = 0.9; lmcoord.x = min(lmcoord.x, 0.925);}
else opaqueMasks = 0.45;
#endif
#if !defined BLOCKENTITIES && !defined ENTITIES && defined SHADER_GRASS && !defined COLORWHEEL && !defined HAND && !defined CUTOUT
@@ -574,8 +577,6 @@ void main() {
float textureLOD = bias();
vec2 lmcoord = data_in.lmtexcoord.zw;
vec4 Color = data_in.color;
#ifndef COLORWHEEL
+12 -5
View File
@@ -906,7 +906,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
} else {
#if defined ENTITIES && defined IS_IRIS
float nameTagMask = 0.0;
if(NAMETAG > 0) nameTagMask = 1.0;
if(NAMETAG == 1) nameTagMask = 1.0;
#else
const float nameTagMask = 0.0;
#endif
@@ -1071,10 +1071,17 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
vec3 lightColor = vec3(TORCH_R,TORCH_G,TORCH_B);
#endif
#ifdef MAIN_SHADOW_PASS
Indirect_lighting += doBlockLightLighting(lightColor, lightmap.x, feetPlayerPos, lpvPos, viewPos, false, BN, worldSpaceNormal, false, false);
#if defined ENTITIES && defined IS_IRIS
bool glowframe = NAMETAG == 2;
if(glowframe) lightmap.x = min(lightmap.x, 0.925);
#else
Indirect_lighting += doBlockLightLighting(lightColor, lightmap.x, feetPlayerPos, lpvPos, false);
const bool glowframe = false;
#endif
#ifdef MAIN_SHADOW_PASS
Indirect_lighting += doBlockLightLighting(lightColor, lightmap.x, feetPlayerPos, lpvPos, viewPos, false, BN, worldSpaceNormal, false, glowframe, false);
#else
Indirect_lighting += doBlockLightLighting(lightColor, lightmap.x, feetPlayerPos, lpvPos, glowframe, false);
#endif
vec4 flashLightSpecularData = vec4(0.0);
@@ -1201,7 +1208,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
gl_FragData[3] = vec4(1, 1, encodeVec2(lightmap.x, lightmap.y), 1);
#if defined ENTITIES && defined IS_IRIS && !defined COLORWHEEL
if(NAMETAG > 0) {
if(NAMETAG == 1) {
// WHY DO THEY HAVE TO AHVE LIGHTING AAAAAAUGHAUHGUAHG
#ifndef OVERWORLD_SHADER
lightmap.y = 0.0;
+1
View File
@@ -258,6 +258,7 @@ void main() {
#if defined ENTITIES && defined IS_IRIS
NAMETAG = 0;
if (entityId == 1600) NAMETAG = 1;
else if (entityId == 1615) NAMETAG = 2;
#endif
+3 -2
View File
@@ -1145,7 +1145,8 @@ void main() {
const float POM_DEEPNESS = 0.0;
#endif
// bool handwater = abs(translucentMasks-0.3) < 0.01 ;
bool opaqueParticles = abs(opaqueMasks-0.85) <0.01;
bool opaqueParticles = abs(opaqueMasks-0.85) < 0.01;
bool glowframe = abs(opaqueMasks-0.9) < 0.01;
if(hand){
convertHandDepth(z);
@@ -1595,7 +1596,7 @@ void main() {
const vec3 lpvPos = vec3(0.0);
#endif
vec3 blockLightColor = doBlockLightLighting(vec3(TORCH_R,TORCH_G,TORCH_B), lightmap.x, feetPlayerPos, lpvPos, viewPos, isDHrange, blueNoise(), FlatNormals, hand, opaqueParticles);
vec3 blockLightColor = doBlockLightLighting(vec3(TORCH_R,TORCH_G,TORCH_B), lightmap.x, feetPlayerPos, lpvPos, viewPos, isDHrange, blueNoise(), FlatNormals, hand, glowframe, opaqueParticles);
Indirect_lighting += blockLightColor;
vec4 flashLightSpecularData = vec4(0.0);
+1 -1
View File
@@ -296,7 +296,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
vec3 lightColor = vec3(TORCH_R,TORCH_G,TORCH_B);
const vec3 lpvPos = vec3(0.0);
Indirect_lighting += doBlockLightLighting(lightColor, parameters.lightMap.x * 0.8, feetPlayerPos, lpvPos, false);
Indirect_lighting += doBlockLightLighting(lightColor, parameters.lightMap.x * 0.8, feetPlayerPos, lpvPos, false, false);
vec3 FinalColor = (Indirect_lighting + Direct_lighting*indoors) * Albedo;
+2
View File
@@ -35,6 +35,8 @@ entity.1613=smallships:cog smallships:brigg
#if MC_VERSION > 12100 && ((MC_VERSION != 12109 && MC_VERSION != 12110) || IRIS_VERSION >= 10907)
entity.1614=current_player
#endif
entity.1615=glow_item_frame
################################################
###### SUB-SURFACE SCATTERING
################################################
+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 = 8.3.3
value.SHADER_VERSION_LABEL.482 = 8.3.4
iris_extension.keybind.key0.name=Flashlight
+1 -1
View File
@@ -1,6 +1,6 @@
option.SHADER_VERSION_LABEL = §d§lECLIPSE§r - Bliss 编辑版
prefix.SHADER_VERSION_LABEL = 版本
value.SHADER_VERSION_LABEL.482 = 8.3.3
value.SHADER_VERSION_LABEL.482 = 8.3.4
# 如果你是来翻译的,这不是玩笑,这些选项的功能正如其名
profile.POTATO=§4土豆 (极低配置)
+8 -2
View File
@@ -108,7 +108,8 @@ vec3 doBlockLightLighting(
, vec3 viewPos, bool depthCheck, float noise, vec3 normals, bool hand
#endif
, bool patricles
, bool glowframe
, bool particles
){
lightmap = clamp(lightmap,0.0,1.0);
@@ -128,7 +129,12 @@ vec3 doBlockLightLighting(
lpvSample.rgb *= lightmapCurve;
#endif
if(patricles) lpvSample.rgb += lightmapCurve;
if(particles) {
float luma = dot(lpvSample.rgb,vec3(0.21, 0.72, 0.07));
lpvSample.rgb += lightmapCurve * (1.0 - clamp(luma * 2.0, 0.0, 1.0));
}
else if(glowframe) lpvSample.rgb += lightmapCurve * (1.0 - lightmap);
// vec3 lpvBlockLight = GetLpvBlockLight(lpvSample);
// create a smooth falloff at the edges of the voxel volume.
+1
View File
@@ -14,6 +14,7 @@
#define ENTITY_BOAT 1612
#define ENTITY_SMALLSHIPS 1613
#define ENTITY_CURRENT_PLAYER 1614
#define ENTITY_GLOW_ITEM_FRAME 1615
#define ENTITY_SSS_MEDIUM 1801
#define ENTITY_SSS_WEAK 1802
#define ENTITY_SSS_NONE 1803
+2 -2
View File
@@ -136,9 +136,9 @@ void PopulateShadowVoxel(const in vec3 playerPos) {
}
else if (currentRenderedItemId > 100 && currentRenderedItemId < 276) {
#if MC_VERSION > 12100 && ((MC_VERSION != 12109 && MC_VERSION != 12110) || IRIS_VERSION >= 10907)
if (entityId != ENTITY_ITEM_FRAME && entityId != ENTITY_CURRENT_PLAYER)
if (entityId != ENTITY_ITEM_FRAME && entityId != ENTITY_CURRENT_PLAYER && entityId != ENTITY_GLOW_ITEM_FRAME)
#else
if (entityId != ENTITY_ITEM_FRAME && entityId != ENTITY_PLAYER)
if (entityId != ENTITY_ITEM_FRAME && entityId != ENTITY_PLAYER && entityId != ENTITY_GLOW_ITEM_FRAME)
#endif
{
voxelId = uint(currentRenderedItemId);