Fix OBJ materials

- Fix OBJ model materials to use correct Ka and Kd
- Remove unnecessary material properties
- Rename disableDiffuseMult to disableDiffuse
- Fix curved track outlines rendering in spectator mode
This commit is contained in:
PepperCode1 2022-07-07 17:57:09 -07:00
parent c491dd8f13
commit 917c6041ba
19 changed files with 20 additions and 195 deletions

View file

@ -56,7 +56,7 @@ public class DisplayLinkRenderer extends SafeTileEntityRenderer<DisplayLinkTileE
CachedBufferer.partial(AllBlockPartials.DISPLAY_LINK_GLOW, blockState)
.light(LightTexture.FULL_BRIGHT)
.color(color, color, color, 255)
.disableDiffuseMult()
.disableDiffuse()
.renderInto(ms, buffer.getBuffer(RenderTypes.getAdditive()));
ms.popPose();

View file

@ -168,7 +168,7 @@ public class NixieTubeRenderer extends SafeTileEntityRenderer<NixieTubeTileEntit
CachedBufferer.partial(AllBlockPartials.SIGNAL_WHITE_CUBE, blockState)
.light(0xf000f0)
.disableDiffuseMult()
.disableDiffuse()
.scale(vert ? longSide : 1, vert ? 1 : longSide, 1)
.renderInto(ms, buffer.getBuffer(RenderType.translucent()));
@ -178,7 +178,7 @@ public class NixieTubeRenderer extends SafeTileEntityRenderer<NixieTubeTileEntit
: yellow ? AllBlockPartials.SIGNAL_YELLOW_GLOW : AllBlockPartials.SIGNAL_WHITE_GLOW,
blockState)
.light(0xf000f0)
.disableDiffuseMult()
.disableDiffuse()
.scale(vert ? longSideGlow : 2, vert ? 2 : longSideGlow, 2)
.renderInto(ms, buffer.getBuffer(RenderTypes.getAdditive()));
}
@ -187,7 +187,7 @@ public class NixieTubeRenderer extends SafeTileEntityRenderer<NixieTubeTileEntit
.partial(first ? AllBlockPartials.SIGNAL_RED
: yellow ? AllBlockPartials.SIGNAL_YELLOW : AllBlockPartials.SIGNAL_WHITE, blockState)
.light(0xF000F0)
.disableDiffuseMult()
.disableDiffuse()
.scale(1 + 1 / 16f)
.renderInto(ms, buffer.getBuffer(RenderTypes.getAdditive()));

View file

@ -27,6 +27,7 @@ import net.minecraft.core.Direction;
import net.minecraft.core.Direction.Axis;
import net.minecraft.util.Mth;
import net.minecraft.world.entity.ai.attributes.AttributeInstance;
import net.minecraft.world.level.GameType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.BlockHitResult;
@ -142,6 +143,10 @@ public class TrackBlockOutline {
}
public static void drawCurveSelection(PoseStack ms, MultiBufferSource buffer) {
Minecraft mc = Minecraft.getInstance();
if (mc.options.hideGui || mc.gameMode.getPlayerMode() == GameType.SPECTATOR)
return;
BezierPointSelection result = TrackBlockOutline.result;
if (result == null)
return;

View file

@ -337,7 +337,7 @@ public class SuperByteBuffer implements Transform<SuperByteBuffer>, TStack<Super
* from the final transformed normal vector. Useful for entity rendering, when
* diffuse is applied automatically later.
*/
public SuperByteBuffer disableDiffuseMult() {
public SuperByteBuffer disableDiffuse() {
disableDiffuseMult = true;
return this;
}
@ -438,7 +438,7 @@ public class SuperByteBuffer implements Transform<SuperByteBuffer>, TStack<Super
}
public SuperByteBuffer forEntityRender() {
disableDiffuseMult();
disableDiffuse();
overlay();
fullNormalTransform();
return this;

View file

@ -2,13 +2,4 @@
# Material Count: 1
newmtl m_0
Ns 250.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd #0
map_d #0

View file

@ -2,12 +2,5 @@
# Material Count: 1
newmtl m_0
Ns 250.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd #0

View file

@ -2,13 +2,5 @@
# Material Count: 1
newmtl m_0
Ns 0.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 1
map_Kd #0
map_d #0

View file

@ -2,24 +2,8 @@
# Material Count: 2
newmtl Blazier
Ns 250.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd #0
map_d #0
newmtl Campfire
Ns 250.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd #1

View file

@ -2,25 +2,8 @@
# Material Count: 2
newmtl m_0
Ns 250.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd #0
map_d #0
newmtl m_1
Ns 0.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 1
map_Kd #1
map_d #1

View file

@ -2,34 +2,10 @@
# Material Count: 3
newmtl m_0
Ns 250.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd #0
newmtl m_1
Ns 250.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd #1
newmtl m_2
Ns 250.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd #2

View file

@ -1,6 +1,9 @@
# Made in Blockbench 4.1.4
newmtl m_2
map_Kd #1
newmtl m_1_0
map_Kd #0
newmtl none

View file

@ -2,45 +2,13 @@
# Material Count: 4
newmtl Belts
Ns 0.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 1
map_Kd #belt
newmtl Bogey_Body
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd #bogey
newmtl Bogey_Piston
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd #piston
newmtl wheel_Large
Ns 0.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 1
map_Kd #wheel

View file

@ -2,12 +2,4 @@
# Material Count: 1
newmtl Bogey_Piston
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd #piston

View file

@ -2,12 +2,4 @@
# Material Count: 1
newmtl wheel_Large
Ns 0.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 1
map_Kd #wheel

View file

@ -2,12 +2,4 @@
# Material Count: 1
newmtl Bogey_Piston
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd #piston

View file

@ -2,34 +2,10 @@
# Material Count: 3
newmtl Bogey_Body
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd #bogey
newmtl Bogey_Body_2
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd #bogey2
newmtl wheel_Large
Ns 0.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 1
map_Kd #wheel

View file

@ -2,34 +2,10 @@
# Material Count: 3
newmtl 00_Shaft
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd #axis
newmtl 00_Shaft_end
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd #axis_top
newmtl wheel_Large
Ns 0.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 1
map_Kd #wheel

View file

@ -1,7 +1,5 @@
{
"parent": "block/block",
"ambientToFullbright": false,
"diffuseLighting": false,
"textures": {
"belt": "create:block/bogey/belt",
"bogey": "create:block/bogey/frame",

View file

@ -1,8 +1,12 @@
# Made in Blockbench 4.1.1
newmtl m_0
map_Kd #0
newmtl m_1
map_Kd #1
newmtl m_2
map_Kd #2
newmtl none