mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Introduce RegisterShadersEvent to register shaders with the proper timing (runs every client resource reload).
Fix ShaderInstance to allow resourcelocations with namespaces as input. Fix shader parsing to respect resource domains. Fix ForgeRenderTypes to use the right shader in each situation. Add custom forge shader for unlit translucent entity rendering, equivalent to the vanilla entity translucent shader.
This commit is contained in:
1 parent
7d4c238165
commit
80d08dbf3a
9 files changed
+273
-37
No files matched your search
@@ -21,8 +21,7 @@ package net.minecraftforge.client;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||
import com.mojang.blaze3d.vertex.*;
|
||||
import net.minecraft.client.model.geom.ModelLayerLocation;
|
||||
import net.minecraft.client.model.geom.builders.LayerDefinition;
|
||||
import net.minecraft.client.renderer.entity.EntityRendererProvider;
|
||||
@@ -52,8 +51,6 @@ import net.minecraft.client.resources.model.Material;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlas;
|
||||
import com.mojang.blaze3d.platform.NativeImage;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import com.mojang.blaze3d.vertex.VertexFormat;
|
||||
import com.mojang.blaze3d.vertex.VertexFormatElement;
|
||||
import com.mojang.blaze3d.vertex.VertexFormatElement.Usage;
|
||||
import net.minecraft.client.resources.language.I18n;
|
||||
import net.minecraft.client.KeyMapping;
|
||||
@@ -87,6 +84,7 @@ import net.minecraft.world.level.GameType;
|
||||
import net.minecraft.world.level.BlockAndTintGetter;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.levelgen.WorldGenSettings;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.client.event.*;
|
||||
import net.minecraftforge.client.event.sound.PlaySoundEvent;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
@@ -96,8 +94,10 @@ import net.minecraftforge.common.ForgeMod;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.model.TransformationHelper;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.ModLoader;
|
||||
import net.minecraftforge.fml.VersionChecker;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fmlclient.registry.ClientRegistry;
|
||||
import net.minecraftforge.fml.StartupMessageManager;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
@@ -113,6 +113,7 @@ import org.lwjgl.opengl.GL13;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
@@ -859,4 +860,23 @@ public class ForgeHooksClient
|
||||
layerDefinitions.forEach((k, v) -> builder.put(k, v.get()));
|
||||
}
|
||||
|
||||
@Mod.EventBusSubscriber(value = Dist.CLIENT, modid="forge", bus= Mod.EventBusSubscriber.Bus.MOD)
|
||||
public static class ClientEvents
|
||||
{
|
||||
@Nullable
|
||||
private static ShaderInstance rendertypeEntityTranslucentUnlitShader;
|
||||
|
||||
public static ShaderInstance getEntityTranslucentUnlitShader()
|
||||
{
|
||||
return Objects.requireNonNull(rendertypeEntityTranslucentUnlitShader, "Attempted to call getEntityTranslucentUnlitShader before shaders have finished loading.");
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerShaders(RegisterShadersEvent event) throws IOException
|
||||
{
|
||||
event.registerShader(new ShaderInstance(event.getResourceManager(), new ResourceLocation("forge","rendertype_entity_unlit_translucent"), DefaultVertexFormat.NEW_ENTITY), (p_172645_) -> {
|
||||
rendertypeEntityTranslucentUnlitShader = p_172645_;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,18 +20,31 @@
|
||||
package net.minecraftforge.client;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.mojang.datafixers.util.Pair;
|
||||
import net.minecraft.Util;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.RenderStateShard;
|
||||
import net.minecraft.client.renderer.RenderStateShard.TextureStateShard;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.client.renderer.ShaderInstance;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlas;
|
||||
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
|
||||
import com.mojang.blaze3d.vertex.VertexFormat;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.server.packs.resources.ResourceManager;
|
||||
import net.minecraftforge.client.event.RegisterShadersEvent;
|
||||
import net.minecraftforge.common.util.NonNullLazy;
|
||||
import net.minecraftforge.common.util.NonNullSupplier;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@@ -52,7 +65,7 @@ public enum ForgeRenderTypes
|
||||
*/
|
||||
public static RenderType getItemLayeredSolid(ResourceLocation textureLocation)
|
||||
{
|
||||
return Internal.layeredItemSolid(textureLocation);
|
||||
return Internal.LAYERED_ITEM_SOLID.apply(textureLocation);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,7 +73,7 @@ public enum ForgeRenderTypes
|
||||
*/
|
||||
public static RenderType getItemLayeredCutout(ResourceLocation textureLocation)
|
||||
{
|
||||
return Internal.layeredItemCutout(textureLocation);
|
||||
return Internal.LAYERED_ITEM_CUTOUT.apply(textureLocation);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,7 +81,7 @@ public enum ForgeRenderTypes
|
||||
*/
|
||||
public static RenderType getItemLayeredCutoutMipped(ResourceLocation textureLocation)
|
||||
{
|
||||
return Internal.layeredItemCutoutMipped(textureLocation);
|
||||
return Internal.LAYERED_ITEM_CUTOUT_MIPPED.apply(textureLocation);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,7 +89,7 @@ public enum ForgeRenderTypes
|
||||
*/
|
||||
public static RenderType getItemLayeredTranslucent(ResourceLocation textureLocation)
|
||||
{
|
||||
return Internal.layeredItemTranslucent(textureLocation);
|
||||
return Internal.LAYERED_ITEM_TRANSLUCENT.apply(textureLocation);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,7 +97,7 @@ public enum ForgeRenderTypes
|
||||
*/
|
||||
public static RenderType getUnsortedTranslucent(ResourceLocation textureLocation)
|
||||
{
|
||||
return Internal.unsortedTranslucent(textureLocation);
|
||||
return Internal.UNSORTED_TRANSLUCENT.apply(textureLocation);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -93,7 +106,7 @@ public enum ForgeRenderTypes
|
||||
*/
|
||||
public static RenderType getUnlitTranslucent(ResourceLocation textureLocation)
|
||||
{
|
||||
return getUnlitTranslucent(textureLocation, true);
|
||||
return Internal.UNLIT_TRANSLUCENT_SORTED.apply(textureLocation);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -103,31 +116,31 @@ public enum ForgeRenderTypes
|
||||
*/
|
||||
public static RenderType getUnlitTranslucent(ResourceLocation textureLocation, boolean sortingEnabled)
|
||||
{
|
||||
return Internal.unlitTranslucent(textureLocation, sortingEnabled);
|
||||
return (sortingEnabled ? Internal.UNLIT_TRANSLUCENT_SORTED : Internal.UNLIT_TRANSLUCENT_UNSORTED).apply(textureLocation);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Same as {@link RenderType#getEntityCutout(ResourceLocation)}, but with mipmapping enabled.
|
||||
* @return Same as {@link RenderType#entityCutout(ResourceLocation)}, but with mipmapping enabled.
|
||||
*/
|
||||
public static RenderType getEntityCutoutMipped(ResourceLocation textureLocation)
|
||||
{
|
||||
return Internal.layeredItemCutoutMipped(textureLocation);
|
||||
return Internal.LAYERED_ITEM_CUTOUT_MIPPED.apply(textureLocation);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Replacement of {@link RenderType#getText(ResourceLocation)}, but with optional linear texture filtering.
|
||||
* @return Replacement of {@link RenderType#text(ResourceLocation)}, but with optional linear texture filtering.
|
||||
*/
|
||||
public static RenderType getText(ResourceLocation locationIn)
|
||||
{
|
||||
return Internal.getText(locationIn);
|
||||
return Internal.TEXT.apply(locationIn);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Replacement of {@link RenderType#getTextSeeThrough(ResourceLocation)}, but with optional linear texture filtering.
|
||||
* @return Replacement of {@link RenderType#textSeeThrough(ResourceLocation)}, but with optional linear texture filtering.
|
||||
*/
|
||||
public static RenderType getTextSeeThrough(ResourceLocation locationIn)
|
||||
{
|
||||
return Internal.getTextSeeThrough(locationIn);
|
||||
return Internal.TEXT_SEETHROUGH.apply(locationIn);
|
||||
}
|
||||
|
||||
// ----------------------------------------
|
||||
@@ -147,22 +160,25 @@ public enum ForgeRenderTypes
|
||||
return renderTypeSupplier.get();
|
||||
}
|
||||
|
||||
|
||||
private static class Internal extends RenderType
|
||||
{
|
||||
private static final ShaderStateShard RENDERTYPE_ENTITY_TRANSLUCENT_UNLIT_SHADER = new ShaderStateShard(ForgeHooksClient.ClientEvents::getEntityTranslucentUnlitShader);
|
||||
|
||||
private Internal(String name, VertexFormat fmt, VertexFormat.Mode glMode, int size, boolean doCrumbling, boolean depthSorting, Runnable onEnable, Runnable onDisable)
|
||||
{
|
||||
super(name, fmt, glMode, size, doCrumbling, depthSorting, onEnable, onDisable);
|
||||
throw new IllegalStateException("This class must not be instantiated");
|
||||
}
|
||||
|
||||
public static RenderType unsortedTranslucent(ResourceLocation textureLocation)
|
||||
public static Function<ResourceLocation, RenderType> UNSORTED_TRANSLUCENT = Util.memoize(Internal::unsortedTranslucent);
|
||||
private static RenderType unsortedTranslucent(ResourceLocation textureLocation)
|
||||
{
|
||||
final boolean sortingEnabled = false;
|
||||
CompositeState renderState = CompositeState.builder()
|
||||
.setShaderState(RenderType.RENDERTYPE_ENTITY_TRANSLUCENT_SHADER)
|
||||
.setTextureState(new TextureStateShard(textureLocation, false, false))
|
||||
.setTransparencyState(TRANSLUCENT_TRANSPARENCY)
|
||||
// .setDiffuseLightingState(DIFFUSE_LIGHTING) //TODO
|
||||
// .setAlphaState(DEFAULT_ALPHA) //TODO
|
||||
.setCullState(NO_CULL)
|
||||
.setLightmapState(LIGHTMAP)
|
||||
.setOverlayState(OVERLAY)
|
||||
@@ -170,12 +186,26 @@ public enum ForgeRenderTypes
|
||||
return create("forge_entity_unsorted_translucent", DefaultVertexFormat.NEW_ENTITY, VertexFormat.Mode.QUADS, 256, true, sortingEnabled, renderState);
|
||||
}
|
||||
|
||||
public static RenderType unlitTranslucent(ResourceLocation textureLocation, boolean sortingEnabled)
|
||||
private static final BiFunction<ResourceLocation, Boolean, RenderType> ENTITY_TRANSLUCENT = Util.memoize((p_173227_, p_173228_) -> {
|
||||
RenderType.CompositeState rendertype$compositestate = RenderType.CompositeState.builder()
|
||||
.setShaderState(RENDERTYPE_ENTITY_TRANSLUCENT_SHADER)
|
||||
.setTextureState(new RenderStateShard.TextureStateShard(p_173227_, false, false))
|
||||
.setTransparencyState(TRANSLUCENT_TRANSPARENCY)
|
||||
.setCullState(NO_CULL)
|
||||
.setLightmapState(LIGHTMAP)
|
||||
.setOverlayState(OVERLAY)
|
||||
.createCompositeState(p_173228_);
|
||||
return create("entity_translucent", DefaultVertexFormat.NEW_ENTITY, VertexFormat.Mode.QUADS, 256, true, true, rendertype$compositestate);
|
||||
});
|
||||
|
||||
public static Function<ResourceLocation, RenderType> UNLIT_TRANSLUCENT_SORTED = Util.memoize(tex -> Internal.unlitTranslucent(tex, true));
|
||||
public static Function<ResourceLocation, RenderType> UNLIT_TRANSLUCENT_UNSORTED = Util.memoize(tex -> Internal.unlitTranslucent(tex, false));
|
||||
private static RenderType unlitTranslucent(ResourceLocation textureLocation, boolean sortingEnabled)
|
||||
{
|
||||
CompositeState renderState = CompositeState.builder()
|
||||
.setShaderState(RENDERTYPE_ENTITY_TRANSLUCENT_UNLIT_SHADER)
|
||||
.setTextureState(new TextureStateShard(textureLocation, false, false))
|
||||
.setTransparencyState(TRANSLUCENT_TRANSPARENCY)
|
||||
// .setAlphaState(DEFAULT_ALPHA) //TODO
|
||||
.setCullState(NO_CULL)
|
||||
.setLightmapState(LIGHTMAP)
|
||||
.setOverlayState(OVERLAY)
|
||||
@@ -183,67 +213,70 @@ public enum ForgeRenderTypes
|
||||
return create("forge_entity_unlit_translucent", DefaultVertexFormat.NEW_ENTITY, VertexFormat.Mode.QUADS, 256, true, sortingEnabled, renderState);
|
||||
}
|
||||
|
||||
public static RenderType layeredItemSolid(ResourceLocation locationIn) {
|
||||
public static Function<ResourceLocation, RenderType> LAYERED_ITEM_SOLID = Util.memoize(Internal::layeredItemSolid);
|
||||
private static RenderType layeredItemSolid(ResourceLocation locationIn) {
|
||||
RenderType.CompositeState rendertype$state = RenderType.CompositeState.builder()
|
||||
.setShaderState(RenderType.RENDERTYPE_ENTITY_SOLID_SHADER)
|
||||
.setTextureState(new RenderStateShard.TextureStateShard(locationIn, false, false))
|
||||
.setTransparencyState(NO_TRANSPARENCY)
|
||||
// .setDiffuseLightingState(DIFFUSE_LIGHTING) //TODO
|
||||
.setLightmapState(LIGHTMAP)
|
||||
.setOverlayState(OVERLAY)
|
||||
.createCompositeState(true);
|
||||
return create("forge_item_entity_solid", DefaultVertexFormat.NEW_ENTITY, VertexFormat.Mode.QUADS, 256, true, false, rendertype$state);
|
||||
}
|
||||
|
||||
public static RenderType layeredItemCutout(ResourceLocation locationIn) {
|
||||
public static Function<ResourceLocation, RenderType> LAYERED_ITEM_CUTOUT = Util.memoize(Internal::layeredItemCutout);
|
||||
private static RenderType layeredItemCutout(ResourceLocation locationIn) {
|
||||
RenderType.CompositeState rendertype$state = RenderType.CompositeState.builder()
|
||||
.setShaderState(RenderType.RENDERTYPE_ENTITY_CUTOUT_SHADER)
|
||||
.setTextureState(new RenderStateShard.TextureStateShard(locationIn, false, false))
|
||||
.setTransparencyState(NO_TRANSPARENCY)
|
||||
// .setDiffuseLightingState(DIFFUSE_LIGHTING) //TODO
|
||||
// .setAlphaState(DEFAULT_ALPHA) //TODO
|
||||
.setLightmapState(LIGHTMAP)
|
||||
.setOverlayState(OVERLAY)
|
||||
.createCompositeState(true);
|
||||
return create("forge_item_entity_cutout", DefaultVertexFormat.NEW_ENTITY, VertexFormat.Mode.QUADS, 256, true, false, rendertype$state);
|
||||
}
|
||||
|
||||
public static RenderType layeredItemCutoutMipped(ResourceLocation locationIn) {
|
||||
public static Function<ResourceLocation, RenderType> LAYERED_ITEM_CUTOUT_MIPPED = Util.memoize(Internal::layeredItemCutoutMipped);
|
||||
private static RenderType layeredItemCutoutMipped(ResourceLocation locationIn) {
|
||||
RenderType.CompositeState rendertype$state = RenderType.CompositeState.builder()
|
||||
.setShaderState(RenderType.RENDERTYPE_ENTITY_SMOOTH_CUTOUT_SHADER)
|
||||
.setTextureState(new RenderStateShard.TextureStateShard(locationIn, false, true))
|
||||
.setTransparencyState(NO_TRANSPARENCY)
|
||||
// .setDiffuseLightingState(DIFFUSE_LIGHTING) //TODO
|
||||
// .setAlphaState(DEFAULT_ALPHA) //TODO
|
||||
.setLightmapState(LIGHTMAP)
|
||||
.setOverlayState(OVERLAY)
|
||||
.createCompositeState(true);
|
||||
return create("forge_item_entity_cutout_mipped", DefaultVertexFormat.NEW_ENTITY, VertexFormat.Mode.QUADS, 256, true, false, rendertype$state);
|
||||
}
|
||||
|
||||
public static RenderType layeredItemTranslucent(ResourceLocation locationIn) {
|
||||
public static Function<ResourceLocation, RenderType> LAYERED_ITEM_TRANSLUCENT = Util.memoize(Internal::layeredItemTranslucent);
|
||||
private static RenderType layeredItemTranslucent(ResourceLocation locationIn) {
|
||||
RenderType.CompositeState rendertype$state = RenderType.CompositeState.builder()
|
||||
.setShaderState(RenderType.RENDERTYPE_ENTITY_TRANSLUCENT_SHADER)
|
||||
.setTextureState(new RenderStateShard.TextureStateShard(locationIn, false, false))
|
||||
.setTransparencyState(TRANSLUCENT_TRANSPARENCY)
|
||||
// .setDiffuseLightingState(DIFFUSE_LIGHTING) //TODO
|
||||
// .setAlphaState(DEFAULT_ALPHA) //TODO
|
||||
.setLightmapState(LIGHTMAP)
|
||||
.setOverlayState(OVERLAY)
|
||||
.createCompositeState(true);
|
||||
return create("forge_item_entity_translucent_cull", DefaultVertexFormat.NEW_ENTITY, VertexFormat.Mode.QUADS, 256, true, true, rendertype$state);
|
||||
}
|
||||
|
||||
public static RenderType getText(ResourceLocation locationIn) {
|
||||
public static Function<ResourceLocation, RenderType> TEXT = Util.memoize(Internal::getText);
|
||||
private static RenderType getText(ResourceLocation locationIn) {
|
||||
RenderType.CompositeState rendertype$state = RenderType.CompositeState.builder()
|
||||
.setShaderState(RENDERTYPE_TEXT_SHADER)
|
||||
.setTextureState(new CustomizableTextureState(locationIn, () -> ForgeRenderTypes.enableTextTextureLinearFiltering, () -> false))
|
||||
// .setAlphaState(DEFAULT_ALPHA) //TODO
|
||||
.setTransparencyState(TRANSLUCENT_TRANSPARENCY)
|
||||
.setLightmapState(LIGHTMAP)
|
||||
.createCompositeState(false);
|
||||
return create("forge_text", DefaultVertexFormat.POSITION_COLOR_TEX_LIGHTMAP, VertexFormat.Mode.QUADS, 256, false, true, rendertype$state);
|
||||
}
|
||||
|
||||
public static RenderType getTextSeeThrough(ResourceLocation locationIn) {
|
||||
public static Function<ResourceLocation, RenderType> TEXT_SEETHROUGH = Util.memoize(Internal::getTextSeeThrough);
|
||||
private static RenderType getTextSeeThrough(ResourceLocation locationIn) {
|
||||
RenderType.CompositeState rendertype$state = RenderType.CompositeState.builder()
|
||||
.setShaderState(RENDERTYPE_TEXT_SHADER)
|
||||
.setTextureState(new CustomizableTextureState(locationIn, () -> ForgeRenderTypes.enableTextTextureLinearFiltering, () -> false))
|
||||
// .setAlphaState(DEFAULT_ALPHA) //TODO
|
||||
.setTransparencyState(TRANSLUCENT_TRANSPARENCY)
|
||||
.setLightmapState(LIGHTMAP)
|
||||
.setDepthTestState(NO_DEPTH_TEST)
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2021.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
package net.minecraftforge.client.event;
|
||||
|
||||
import com.mojang.datafixers.util.Pair;
|
||||
import net.minecraft.client.renderer.ShaderInstance;
|
||||
import net.minecraft.server.packs.resources.ResourceManager;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
import net.minecraftforge.fml.event.IModBusEvent;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class RegisterShadersEvent extends Event implements IModBusEvent
|
||||
{
|
||||
private final ResourceManager resourceManager;
|
||||
private final List<Pair<ShaderInstance, Consumer<ShaderInstance>>> shaderList;
|
||||
|
||||
public RegisterShadersEvent(ResourceManager resourceManager, List<Pair<ShaderInstance, Consumer<ShaderInstance>>> shaderList)
|
||||
{
|
||||
this.resourceManager = resourceManager;
|
||||
this.shaderList = shaderList;
|
||||
}
|
||||
|
||||
public ResourceManager getResourceManager()
|
||||
{
|
||||
return resourceManager;
|
||||
}
|
||||
|
||||
public void registerShader(ShaderInstance shaderInstance, Consumer<ShaderInstance> onLoaded)
|
||||
{
|
||||
shaderList.add(Pair.of(shaderInstance, onLoaded));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user