mirror of
https://github.com/FabricMC/fabric.git
synced 2025-04-11 22:45:38 -04:00
Environmental renderers (#1727)
* Environmental Renderers * Remove defunt hideClouds and hideWeather * Pushed missing License * Push checkstyle fixes * remove unused * Unwrapped the test mod sky rendering. * Added a first attempt at javadoc. * Forgot a blank line * Moved Environment references out of class * Moved Lamda functions for fog override, thick fog usage and fog color adjustment to their own interfaces and gave them proper javadoc. * Made FabricSkyProperties private * PURGE THE H...I mean FabricSkyPropertyBuilder and FabricSkyProperties. - Reverted unintentional mixin changes - Fix various typo errors that were pointed out. - Added missing javadocs and added the ability to override. * Forgot some pluggin in some overrides. * Added missing javadoc suggestion * Changed api a bit so that it fires a exception if renderer not being overridden and one already exists. * Split Implemtnation and Interface * Forgot a license * Added WorldRenderContext to Renderers * Added logging * Added missing javadocs and removed the override option. * Removed INSTANCE * Environmental Renderers * Remove defunt hideClouds and hideWeather * Pushed missing License * Push checkstyle fixes * remove unused * Unwrapped the test mod sky rendering. * Added a first attempt at javadoc. * Forgot a blank line * Moved Environment references out of class * Moved Lamda functions for fog override, thick fog usage and fog color adjustment to their own interfaces and gave them proper javadoc. * Made FabricSkyProperties private * PURGE THE H...I mean FabricSkyPropertyBuilder and FabricSkyProperties. - Reverted unintentional mixin changes - Fix various typo errors that were pointed out. - Added missing javadocs and added the ability to override. * Forgot some pluggin in some overrides. * Added missing javadoc suggestion * Changed api a bit so that it fires a exception if renderer not being overridden and one already exists. * Split Implemtnation and Interface * Forgot a license * Added WorldRenderContext to Renderers * Added logging * Added missing javadocs and removed the override option. * Removed INSTANCE * Fixed Issues * Fixed formatting issue. * completed Juuxl's suggestions and removed null check on adding skyproperties. Changed SkyProperties registering to take an Identifier. Registration turns out to be only adding new options to the "effects" entry of dimension type jsonjson. * Forgot to reenable this. * Just did suggested tweaks * Changed SkyProperties to DimensionEffects * Pushed suggestions of Haykam and apple502j * Added missing changes from sky properties to dimension effects. * Corrected me being inconsistent. * Forgot to remove import. * Impliments https://github.com/FabricMC/fabric/pull/1727#discussion_r734988305 https://github.com/FabricMC/fabric/pull/1727#discussion_r734988265 * Implements https://github.com/FabricMC/fabric/pull/1727#discussion_r730429748 * Last minute tweak. Runnable that controls fog runs right before dimension spefific rendering is done. Based on more subtle issues discovered while working api with twilight forest. Co-authored-by: AlphaMode <AlphaModeYT@gmail.com>
This commit is contained in:
parent
5d8be2ee16
commit
b63228675d
8 changed files with 401 additions and 3 deletions
fabric-dimensions-v1/src/testmod/resources/data/fabric_dimension/dimension_type
fabric-rendering-v1/src
main
java/net/fabricmc/fabric
api/client/rendering/v1
impl/client/rendering
mixin/client/rendering
resources
testmod
|
@ -12,5 +12,6 @@
|
|||
"bed_works" : false,
|
||||
"piglin_safe" : false,
|
||||
"height": 256,
|
||||
"min_y": 0
|
||||
"min_y": 0,
|
||||
"effects": "fabric_dimension:void"
|
||||
}
|
||||
|
|
|
@ -0,0 +1,143 @@
|
|||
/*
|
||||
* Copyright (c) 2016, 2017, 2018, 2019 FabricMC
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.fabricmc.fabric.api.client.rendering.v1;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import net.minecraft.client.render.DimensionEffects;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.fabric.impl.client.rendering.DimensionRenderingRegistryImpl;
|
||||
|
||||
/**
|
||||
* Dimensional renderers render world specific visuals of a world.
|
||||
* They may be used to render the sky, weather, or clouds.
|
||||
* The {@link DimensionEffects} is the vanilla dimensional renderer.
|
||||
*/
|
||||
@Environment(EnvType.CLIENT)
|
||||
public interface DimensionRenderingRegistry {
|
||||
/**
|
||||
* Registers the custom sky renderer for a {@link World}.
|
||||
*
|
||||
* <p>This overrides Vanilla's sky rendering.
|
||||
* @param key A {@link RegistryKey} for your {@link World}
|
||||
* @param renderer A {@link SkyRenderer} implementation
|
||||
* @throws IllegalArgumentException if key is already registered.
|
||||
*/
|
||||
static void registerSkyRenderer(RegistryKey<World> key, SkyRenderer renderer) {
|
||||
DimensionRenderingRegistryImpl.registerSkyRenderer(key, renderer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a custom weather renderer for a {@link World}.
|
||||
*
|
||||
* <p>This overrides Vanilla's weather rendering.
|
||||
* @param key A RegistryKey for your {@link World}
|
||||
* @param renderer A {@link WeatherRenderer} implementation
|
||||
* @throws IllegalArgumentException if key is already registered.
|
||||
*/
|
||||
static void registerWeatherRenderer(RegistryKey<World> key, WeatherRenderer renderer) {
|
||||
DimensionRenderingRegistryImpl.registerWeatherRenderer(key, renderer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers dimension effects for an {@link net.minecraft.util.Identifier}.
|
||||
*
|
||||
* <p>This registers a new option for the "effects" entry of the dimension type json.
|
||||
*
|
||||
* @param key The {@link net.minecraft.util.Identifier} for the new option entry.
|
||||
* @param effects The {@link DimensionEffects} option.
|
||||
* @throws IllegalArgumentException if key is already registered.
|
||||
*/
|
||||
static void registerDimensionEffects(Identifier key, DimensionEffects effects) {
|
||||
DimensionRenderingRegistryImpl.registerDimensionEffects(key, effects);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a custom cloud renderer for a {@link World}.
|
||||
*
|
||||
* <p>This overrides Vanilla's cloud rendering.
|
||||
*
|
||||
* @param key A {@link RegistryKey} for your {@link World}
|
||||
* @param renderer A {@link CloudRenderer} implementation
|
||||
* @throws IllegalArgumentException if key is already registered.
|
||||
*/
|
||||
static void registerCloudRenderer(RegistryKey<World> key, CloudRenderer renderer) {
|
||||
DimensionRenderingRegistryImpl.registerCloudRenderer(key, renderer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the custom sky renderer for the given {@link World}.
|
||||
*
|
||||
* @param key A {@link RegistryKey} for your {@link World}
|
||||
* @return {@code null} if no custom sky renderer is registered for the dimension.
|
||||
*/
|
||||
@Nullable
|
||||
static SkyRenderer getSkyRenderer(RegistryKey<World> key) {
|
||||
return DimensionRenderingRegistryImpl.getSkyRenderer(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the custom cloud renderer for the given {@link World}.
|
||||
*
|
||||
* @param key A {@link RegistryKey} for your {@link World}
|
||||
* @return {@code null} if no custom cloud renderer is registered for the dimension.
|
||||
*/
|
||||
@Nullable
|
||||
static CloudRenderer getCloudRenderer(RegistryKey<World> key) {
|
||||
return DimensionRenderingRegistryImpl.getCloudRenderer(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the custom weather effect renderer for the given {@link World}.
|
||||
*
|
||||
* @return {@code null} if no custom weather effect renderer is registered for the dimension.
|
||||
*/
|
||||
@Nullable
|
||||
static WeatherRenderer getWeatherRenderer(RegistryKey<World> key) {
|
||||
return DimensionRenderingRegistryImpl.getWeatherRenderer(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the dimension effects registered for an id.
|
||||
* @param key A {@link RegistryKey} for your {@link World}.
|
||||
* @return overworld effect if no dimension effects is registered for the key.
|
||||
*/
|
||||
@Nullable
|
||||
static DimensionEffects getDimensionEffects(Identifier key) {
|
||||
return DimensionRenderingRegistryImpl.getDimensionEffects(key);
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
interface SkyRenderer {
|
||||
void render(WorldRenderContext context);
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
interface WeatherRenderer {
|
||||
void render(WorldRenderContext context);
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
interface CloudRenderer {
|
||||
void render(WorldRenderContext context);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,89 @@
|
|||
/*
|
||||
* Copyright (c) 2016, 2017, 2018, 2019 FabricMC
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.fabricmc.fabric.impl.client.rendering;
|
||||
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import net.minecraft.client.render.DimensionEffects;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.DimensionRenderingRegistry;
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.DimensionRenderingRegistry.CloudRenderer;
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.DimensionRenderingRegistry.SkyRenderer;
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.DimensionRenderingRegistry.WeatherRenderer;
|
||||
import net.fabricmc.fabric.mixin.client.rendering.DimensionEffectsAccessor;
|
||||
|
||||
public final class DimensionRenderingRegistryImpl {
|
||||
private static final Map<RegistryKey<World>, SkyRenderer> SKY_RENDERERS = new IdentityHashMap<>();
|
||||
private static final Map<RegistryKey<World>, CloudRenderer> CLOUD_RENDERERS = new IdentityHashMap<>();
|
||||
private static final Map<RegistryKey<World>, WeatherRenderer> WEATHER_RENDERERS = new IdentityHashMap<>();
|
||||
|
||||
public static void registerSkyRenderer(RegistryKey<World> key, DimensionRenderingRegistry.SkyRenderer renderer) {
|
||||
Objects.requireNonNull(key);
|
||||
Objects.requireNonNull(renderer);
|
||||
|
||||
SKY_RENDERERS.putIfAbsent(key, renderer);
|
||||
}
|
||||
|
||||
public static void registerWeatherRenderer(RegistryKey<World> key, WeatherRenderer renderer) {
|
||||
Objects.requireNonNull(key);
|
||||
Objects.requireNonNull(renderer);
|
||||
|
||||
WEATHER_RENDERERS.putIfAbsent(key, renderer);
|
||||
}
|
||||
|
||||
public static void registerDimensionEffects(Identifier key, DimensionEffects effects) {
|
||||
Objects.requireNonNull(key);
|
||||
Objects.requireNonNull(effects);
|
||||
//The map containing all dimension effects returns a default if null so a null check doesn't work.
|
||||
|
||||
DimensionEffectsAccessor.getIdentifierMap().putIfAbsent(key, effects);
|
||||
}
|
||||
|
||||
public static void registerCloudRenderer(RegistryKey<World> key, CloudRenderer renderer) {
|
||||
Objects.requireNonNull(key);
|
||||
Objects.requireNonNull(renderer);
|
||||
|
||||
CLOUD_RENDERERS.putIfAbsent(key, renderer);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static SkyRenderer getSkyRenderer(RegistryKey<World> key) {
|
||||
return SKY_RENDERERS.get(key);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static CloudRenderer getCloudRenderer(RegistryKey<World> key) {
|
||||
return CLOUD_RENDERERS.get(key);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static WeatherRenderer getWeatherRenderer(RegistryKey<World> key) {
|
||||
return WEATHER_RENDERERS.get(key);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static DimensionEffects getDimensionEffects(Identifier key) {
|
||||
return DimensionEffectsAccessor.getIdentifierMap().get(key);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Copyright (c) 2016, 2017, 2018, 2019 FabricMC
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.fabricmc.fabric.mixin.client.rendering;
|
||||
|
||||
import it.unimi.dsi.fastutil.objects.Object2ObjectMap;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
|
||||
import net.minecraft.client.render.DimensionEffects;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
@Mixin(DimensionEffects.class)
|
||||
public interface DimensionEffectsAccessor {
|
||||
@Accessor("BY_IDENTIFIER")
|
||||
static Object2ObjectMap<Identifier, DimensionEffects> getIdentifierMap() {
|
||||
throw new AssertionError("This should not occur!");
|
||||
}
|
||||
}
|
|
@ -41,6 +41,7 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Matrix4f;
|
||||
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.DimensionRenderingRegistry;
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.InvalidateRenderStateCallback;
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents;
|
||||
import net.fabricmc.fabric.impl.client.rendering.WorldRenderContextImpl;
|
||||
|
@ -170,4 +171,40 @@ public abstract class MixinWorldRenderer {
|
|||
private void onReload(CallbackInfo ci) {
|
||||
InvalidateRenderStateCallback.EVENT.invoker().onInvalidate();
|
||||
}
|
||||
|
||||
@Inject(at = @At("HEAD"), method = "renderWeather", cancellable = true)
|
||||
private void renderWeather(LightmapTextureManager manager, float tickDelta, double x, double y, double z, CallbackInfo info) {
|
||||
if (this.client.world != null) {
|
||||
DimensionRenderingRegistry.WeatherRenderer renderer = DimensionRenderingRegistry.getWeatherRenderer(world.getRegistryKey());
|
||||
|
||||
if (renderer != null) {
|
||||
renderer.render(context);
|
||||
info.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(at = @At("HEAD"), method = "renderClouds(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/util/math/Matrix4f;FDDD)V", cancellable = true)
|
||||
private void renderCloud(MatrixStack matrices, Matrix4f matrix4f, float tickDelta, double cameraX, double cameraY, double cameraZ, CallbackInfo info) {
|
||||
if (this.client.world != null) {
|
||||
DimensionRenderingRegistry.CloudRenderer renderer = DimensionRenderingRegistry.getCloudRenderer(world.getRegistryKey());
|
||||
|
||||
if (renderer != null) {
|
||||
renderer.render(context);
|
||||
info.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(at = @At(value = "INVOKE", target = "Ljava/lang/Runnable;run()V", shift = At.Shift.AFTER, ordinal = 0), method = "renderSky", cancellable = true)
|
||||
private void renderSky(MatrixStack matrices, Matrix4f matrix4f, float tickDelta, Runnable runnable, CallbackInfo info) {
|
||||
if (this.client.world != null) {
|
||||
DimensionRenderingRegistry.SkyRenderer renderer = DimensionRenderingRegistry.getSkyRenderer(world.getRegistryKey());
|
||||
|
||||
if (renderer != null) {
|
||||
renderer.render(context);
|
||||
info.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,8 @@
|
|||
"LivingEntityRendererAccessor",
|
||||
"MixinBlockEntityRenderers",
|
||||
"MixinEntityRenderers",
|
||||
"ScreenMixin"
|
||||
"ScreenMixin",
|
||||
"DimensionEffectsAccessor"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
|
|
@ -0,0 +1,90 @@
|
|||
/*
|
||||
* Copyright (c) 2016, 2017, 2018, 2019 FabricMC
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.fabricmc.fabric.test.rendering.client;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import net.minecraft.client.render.BufferBuilder;
|
||||
import net.minecraft.client.render.GameRenderer;
|
||||
import net.minecraft.client.render.DimensionEffects;
|
||||
import net.minecraft.client.render.Tessellator;
|
||||
import net.minecraft.client.render.VertexFormat;
|
||||
import net.minecraft.client.render.VertexFormats;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.Matrix4f;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.DimensionRenderingRegistry;
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext;
|
||||
|
||||
public class DimensionalRenderingTest implements ClientModInitializer {
|
||||
private static final Identifier END_SKY = new Identifier("textures/block/dirt.png");
|
||||
|
||||
private static void render(WorldRenderContext context) {
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.defaultBlendFunc();
|
||||
RenderSystem.depthMask(false);
|
||||
RenderSystem.setShader(GameRenderer::getPositionTexColorShader);
|
||||
RenderSystem.setShaderTexture(0, END_SKY);
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
BufferBuilder bufferBuilder = tessellator.getBuffer();
|
||||
|
||||
Matrix4f matrix4f = context.matrixStack().peek().getPositionMatrix();
|
||||
bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE_COLOR);
|
||||
bufferBuilder.vertex(matrix4f, -100.0f, -100.0f, -100.0f).texture(0.0F, 0.0F).color(255, 255, 255, 255).next();
|
||||
bufferBuilder.vertex(matrix4f, -100.0f, -100.0f, 100.0f).texture(0.0F, 1.0F).color(255, 255, 255, 255).next();
|
||||
bufferBuilder.vertex(matrix4f, 100.0f, -100.0f, 100.0f).texture(1.0F, 1.0F).color(255, 255, 255, 255).next();
|
||||
bufferBuilder.vertex(matrix4f, 100.0f, -100.0f, -100.0f).texture(1.0F, 0.0F).color(255, 255, 255, 255).next();
|
||||
|
||||
bufferBuilder.vertex(matrix4f, -100.0f, 100.0f, -100.0f).texture(0.0F, 0.0F).color(255, 255, 255, 255).next();
|
||||
bufferBuilder.vertex(matrix4f, -100.0f, -100.0f, -99.0f).texture(0.0F, 1.0F).color(255, 255, 255, 255).next();
|
||||
bufferBuilder.vertex(matrix4f, 100.0f, -100.0f, -99.0f).texture(1.0F, 1.0F).color(255, 255, 255, 255).next();
|
||||
bufferBuilder.vertex(matrix4f, 100.0f, 100.0f, -100.0f).texture(1.0F, 0.0F).color(255, 255, 255, 255).next();
|
||||
|
||||
bufferBuilder.vertex(matrix4f, -100.0f, -100.0f, 100.0f).texture(0.0F, 0.0F).color(255, 255, 255, 255).next();
|
||||
bufferBuilder.vertex(matrix4f, -100.0f, 100.0f, 100.0f).texture(0.0F, 1.0F).color(255, 255, 255, 255).next();
|
||||
bufferBuilder.vertex(matrix4f, 100.0f, 100.0f, 100.0f).texture(1.0F, 1.0F).color(255, 255, 255, 255).next();
|
||||
bufferBuilder.vertex(matrix4f, 100.0f, -100.0f, 100.0f).texture(1.0F, 0.0F).color(255, 255, 255, 255).next();
|
||||
|
||||
bufferBuilder.vertex(matrix4f, -100.0f, 100.0f, 101.0f).texture(0.0F, 0.0F).color(255, 255, 255, 255).next();
|
||||
bufferBuilder.vertex(matrix4f, -100.0f, 100.0f, -100.0f).texture(0.0F, 1.0F).color(255, 255, 255, 255).next();
|
||||
bufferBuilder.vertex(matrix4f, 100.0f, 100.0f, -100.0f).texture(1.0F, 1.0F).color(255, 255, 255, 255).next();
|
||||
bufferBuilder.vertex(matrix4f, 100.0f, 100.0f, 100.0f).texture(1.0F, 0.0F).color(255, 255, 255, 255).next();
|
||||
|
||||
bufferBuilder.vertex(matrix4f, 100.0f, -100.0f, -100.0f).texture(0.0F, 0.0F).color(255, 255, 255, 255).next();
|
||||
bufferBuilder.vertex(matrix4f, 100.0f, -100.0f, 100.0f).texture(0.0F, 1.0F).color(255, 255, 255, 255).next();
|
||||
bufferBuilder.vertex(matrix4f, 100.0f, 100.0f, 100.0f).texture(1.0F, 1.0F).color(255, 255, 255, 255).next();
|
||||
bufferBuilder.vertex(matrix4f, 100.0f, 100.0f, -100.0f).texture(1.0F, 0.0F).color(255, 255, 255, 255).next();
|
||||
|
||||
bufferBuilder.vertex(matrix4f, -100.0f, 100.0f, -100.0f).texture(0.0F, 0.0F).color(255, 255, 255, 255).next();
|
||||
bufferBuilder.vertex(matrix4f, -100.0f, 100.0f, 100.0f).texture(0.0F, 1.0F).color(255, 255, 255, 255).next();
|
||||
bufferBuilder.vertex(matrix4f, -100.0f, -100.0f, 100.0f).texture(1.0F, 1.0F).color(255, 255, 255, 255).next();
|
||||
bufferBuilder.vertex(matrix4f, -100.0f, -100.0f, -100.0f).texture(1.0F, 0.0F).color(255, 255, 255, 255).next();
|
||||
tessellator.draw();
|
||||
|
||||
RenderSystem.depthMask(true);
|
||||
RenderSystem.enableTexture();
|
||||
RenderSystem.disableBlend();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
DimensionRenderingRegistry.registerSkyRenderer(World.OVERWORLD, DimensionalRenderingTest::render);
|
||||
DimensionRenderingRegistry.registerDimensionEffects(new Identifier("fabric_dimension:void"), new DimensionEffects.End());
|
||||
}
|
||||
}
|
|
@ -16,7 +16,8 @@
|
|||
"net.fabricmc.fabric.test.rendering.client.WorldRenderEventsTests",
|
||||
"net.fabricmc.fabric.test.rendering.client.ArmorRenderingTests",
|
||||
"net.fabricmc.fabric.test.rendering.client.FeatureRendererTest",
|
||||
"net.fabricmc.fabric.test.rendering.client.TooltipComponentTests"
|
||||
"net.fabricmc.fabric.test.rendering.client.TooltipComponentTests",
|
||||
"net.fabricmc.fabric.test.rendering.client.DimensionalRenderingTest"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue