mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-11-10 12:34:11 +01:00
Cut it out!
- Down to just one material shader. - May need some better examples?
This commit is contained in:
parent
301d2f82dd
commit
42c4d311b0
@ -10,7 +10,6 @@ import com.jozufozu.flywheel.lib.util.ShadersModHandler;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.client.renderer.Sheets;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.inventory.InventoryMenu;
|
||||
|
||||
public final class Materials {
|
||||
public static final MaterialVertexTransformer SHADING_TRANSFORMER = (vertexList, level) -> {
|
||||
@ -30,84 +29,58 @@ public final class Materials {
|
||||
private static final ResourceLocation MINECART_LOCATION = new ResourceLocation("textures/entity/minecart.png");
|
||||
|
||||
public static final Material CHUNK_SOLID_SHADED = SimpleMaterial.builder()
|
||||
.baseTexture(InventoryMenu.BLOCK_ATLAS)
|
||||
.mip(true)
|
||||
.shaders(StandardMaterialShaders.SHADED)
|
||||
.fallbackRenderType(RenderType.solid())
|
||||
.vertexTransformer(SHADING_TRANSFORMER)
|
||||
.build();
|
||||
public static final Material CHUNK_SOLID_UNSHADED = SimpleMaterial.builder()
|
||||
.diffuse(false)
|
||||
.baseTexture(InventoryMenu.BLOCK_ATLAS)
|
||||
.mip(true)
|
||||
.fallbackRenderType(RenderType.solid())
|
||||
.build();
|
||||
|
||||
public static final Material CHUNK_CUTOUT_MIPPED_SHADED = SimpleMaterial.builder()
|
||||
.baseTexture(InventoryMenu.BLOCK_ATLAS)
|
||||
.mip(true)
|
||||
.shaders(StandardMaterialShaders.SHADED_CUTOUT)
|
||||
.cutout(Cutout.EPSILON)
|
||||
.fallbackRenderType(RenderType.cutoutMipped())
|
||||
.vertexTransformer(SHADING_TRANSFORMER)
|
||||
.build();
|
||||
public static final Material CHUNK_CUTOUT_MIPPED_UNSHADED = SimpleMaterial.builder()
|
||||
.diffuse(false)
|
||||
.baseTexture(InventoryMenu.BLOCK_ATLAS)
|
||||
.mip(true)
|
||||
.shaders(StandardMaterialShaders.CUTOUT)
|
||||
.cutout(Cutout.EPSILON)
|
||||
.fallbackRenderType(RenderType.cutoutMipped())
|
||||
.build();
|
||||
|
||||
public static final Material CHUNK_CUTOUT_SHADED = SimpleMaterial.builder()
|
||||
.baseTexture(InventoryMenu.BLOCK_ATLAS)
|
||||
.mip(false)
|
||||
.shaders(StandardMaterialShaders.SHADED_CUTOUT)
|
||||
.cutout(Cutout.EPSILON)
|
||||
.fallbackRenderType(RenderType.cutout())
|
||||
.vertexTransformer(SHADING_TRANSFORMER)
|
||||
.build();
|
||||
public static final Material CHUNK_CUTOUT_UNSHADED = SimpleMaterial.builder()
|
||||
.diffuse(false)
|
||||
.baseTexture(InventoryMenu.BLOCK_ATLAS)
|
||||
.mip(false)
|
||||
.shaders(StandardMaterialShaders.CUTOUT)
|
||||
.cutout(Cutout.EPSILON)
|
||||
.fallbackRenderType(RenderType.cutout())
|
||||
.build();
|
||||
|
||||
public static final Material CHUNK_TRANSLUCENT_SHADED = SimpleMaterial.builder()
|
||||
.baseTexture(InventoryMenu.BLOCK_ATLAS)
|
||||
.mip(true)
|
||||
.transparency(Transparency.TRANSLUCENT)
|
||||
.shaders(StandardMaterialShaders.SHADED)
|
||||
.fallbackRenderType(RenderType.translucent())
|
||||
.vertexTransformer(SHADING_TRANSFORMER)
|
||||
.build();
|
||||
public static final Material CHUNK_TRANSLUCENT_UNSHADED = SimpleMaterial.builder()
|
||||
.diffuse(false)
|
||||
.baseTexture(InventoryMenu.BLOCK_ATLAS)
|
||||
.mip(true)
|
||||
.transparency(Transparency.TRANSLUCENT)
|
||||
.fallbackRenderType(RenderType.translucent())
|
||||
.build();
|
||||
|
||||
public static final Material CHUNK_TRIPWIRE_SHADED = SimpleMaterial.builder()
|
||||
.baseTexture(InventoryMenu.BLOCK_ATLAS)
|
||||
.mip(true)
|
||||
.transparency(Transparency.TRANSLUCENT)
|
||||
.shaders(StandardMaterialShaders.SHADED_CUTOUT)
|
||||
.cutout(Cutout.EPSILON)
|
||||
.fallbackRenderType(RenderType.tripwire())
|
||||
.vertexTransformer(SHADING_TRANSFORMER)
|
||||
.build();
|
||||
public static final Material CHUNK_TRIPWIRE_UNSHADED = SimpleMaterial.builder()
|
||||
.diffuse(false)
|
||||
.baseTexture(InventoryMenu.BLOCK_ATLAS)
|
||||
.mip(true)
|
||||
.transparency(Transparency.TRANSLUCENT)
|
||||
.shaders(StandardMaterialShaders.CUTOUT)
|
||||
.cutout(Cutout.EPSILON)
|
||||
.fallbackRenderType(RenderType.tripwire())
|
||||
.build();
|
||||
@ -115,27 +88,22 @@ public final class Materials {
|
||||
public static final Material CHEST = SimpleMaterial.builder()
|
||||
.baseTexture(Sheets.CHEST_SHEET)
|
||||
.mip(false)
|
||||
.shaders(StandardMaterialShaders.SHADED)
|
||||
.fallbackRenderType(Sheets.chestSheet())
|
||||
.build();
|
||||
public static final Material SHULKER = SimpleMaterial.builder()
|
||||
.baseTexture(Sheets.SHULKER_SHEET)
|
||||
.mip(false)
|
||||
.backfaceCull(false)
|
||||
.shaders(StandardMaterialShaders.SHADED_CUTOUT)
|
||||
.cutout(Cutout.EPSILON)
|
||||
.fallbackRenderType(Sheets.shulkerBoxSheet())
|
||||
.build();
|
||||
public static final Material BELL = SimpleMaterial.builder()
|
||||
.baseTexture(InventoryMenu.BLOCK_ATLAS)
|
||||
.mip(false)
|
||||
.shaders(StandardMaterialShaders.SHADED)
|
||||
.fallbackRenderType(Sheets.solidBlockSheet())
|
||||
.build();
|
||||
public static final Material MINECART = SimpleMaterial.builder()
|
||||
.baseTexture(MINECART_LOCATION)
|
||||
.mip(false)
|
||||
.shaders(StandardMaterialShaders.SHADED)
|
||||
.fallbackRenderType(RenderType.entitySolid(MINECART_LOCATION))
|
||||
.build();
|
||||
|
||||
|
@ -9,9 +9,6 @@ import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
public final class StandardMaterialShaders {
|
||||
public static final MaterialShaders DEFAULT = MaterialShaders.REGISTRY.registerAndGet(new SimpleMaterialShaders(Files.DEFAULT_VERTEX, Files.DEFAULT_FRAGMENT));
|
||||
public static final MaterialShaders SHADED = MaterialShaders.REGISTRY.registerAndGet(new SimpleMaterialShaders(Files.SHADED_VERTEX, Files.DEFAULT_FRAGMENT));
|
||||
public static final MaterialShaders CUTOUT = MaterialShaders.REGISTRY.registerAndGet(new SimpleMaterialShaders(Files.DEFAULT_VERTEX, Files.CUTOUT_FRAGMENT));
|
||||
public static final MaterialShaders SHADED_CUTOUT = MaterialShaders.REGISTRY.registerAndGet(new SimpleMaterialShaders(Files.SHADED_VERTEX, Files.CUTOUT_FRAGMENT));
|
||||
|
||||
private StandardMaterialShaders() {
|
||||
}
|
||||
@ -22,14 +19,10 @@ public final class StandardMaterialShaders {
|
||||
|
||||
public static final class Files {
|
||||
public static final ResourceLocation DEFAULT_VERTEX = Names.DEFAULT.withSuffix(".vert");
|
||||
public static final ResourceLocation SHADED_VERTEX = Names.SHADED.withSuffix(".vert");
|
||||
public static final ResourceLocation DEFAULT_FRAGMENT = Names.DEFAULT.withSuffix(".frag");
|
||||
public static final ResourceLocation CUTOUT_FRAGMENT = Names.CUTOUT.withSuffix(".frag");
|
||||
}
|
||||
|
||||
public static final class Names {
|
||||
public static final ResourceLocation DEFAULT = Flywheel.rl("material/default");
|
||||
public static final ResourceLocation SHADED = Flywheel.rl("material/shaded");
|
||||
public static final ResourceLocation CUTOUT = Flywheel.rl("material/cutout");
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +0,0 @@
|
||||
#include "flywheel:api/fragment.glsl"
|
||||
#include "flywheel:util/fog.glsl"
|
||||
|
||||
void flw_materialFragment() {
|
||||
}
|
||||
|
||||
bool flw_discardPredicate(vec4 finalColor) {
|
||||
return finalColor.a < 0.1;
|
||||
}
|
||||
|
||||
vec4 flw_fogFilter(vec4 color) {
|
||||
return linear_fog(color, flw_distance, flywheel.fogRange.x, flywheel.fogRange.y, flywheel.fogColor);
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
#include "flywheel:api/vertex.glsl"
|
||||
#include "flywheel:util/diffuse.glsl"
|
||||
|
||||
void flw_materialVertex() {
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user