Skip to content

Commit

Permalink
Removed deferred renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocelot5836 committed Nov 25, 2024
1 parent 3cc15fc commit cd650bf
Show file tree
Hide file tree
Showing 129 changed files with 95 additions and 2,063 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;

import foundry.veil.api.client.necromancer.render.Skin;
import foundry.veil.api.client.necromancer.render.mesh.Mesh;
import net.minecraft.core.Direction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
import foundry.veil.api.client.necromancer.SkeletonParent;
import foundry.veil.api.client.necromancer.animation.Animation;

import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public abstract class KeyframedAnimation<P extends SkeletonParent, T extends Skeleton<P>> extends Animation<P, T> {
final boolean looped;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import foundry.veil.api.client.render.deferred.light.renderer.IndirectLightRenderer;
import foundry.veil.api.client.render.deferred.light.renderer.LightTypeRenderer;
import foundry.veil.impl.client.editor.LightEditor;
import foundry.veil.impl.client.render.deferred.light.AreaLightRenderer;
import foundry.veil.impl.client.render.deferred.light.DirectionalLightRenderer;
import foundry.veil.impl.client.render.deferred.light.IndirectPointLightRenderer;
import foundry.veil.impl.client.render.deferred.light.InstancedPointLightRenderer;
import foundry.veil.impl.client.render.light.AreaLightRenderer;
import foundry.veil.impl.client.render.light.DirectionalLightRenderer;
import foundry.veil.impl.client.render.light.IndirectPointLightRenderer;
import foundry.veil.impl.client.render.light.InstancedPointLightRenderer;
import foundry.veil.platform.registry.RegistrationProvider;
import net.minecraft.client.Camera;
import net.minecraft.client.multiplayer.ClientLevel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import foundry.veil.api.client.render.deferred.VeilDeferredRenderer;
import foundry.veil.api.client.render.deferred.light.renderer.LightRenderer;
import foundry.veil.api.client.render.dynamicbuffer.DynamicBufferType;
import foundry.veil.api.client.render.framebuffer.FramebufferAttachmentDefinition;
import foundry.veil.api.client.render.framebuffer.FramebufferManager;
import foundry.veil.api.client.render.post.PostPipeline;
import foundry.veil.api.client.render.post.PostProcessingManager;
Expand All @@ -20,7 +19,6 @@
import foundry.veil.impl.client.imgui.VeilImGuiImpl;
import foundry.veil.impl.client.render.dynamicbuffer.DynamicBufferManger;
import foundry.veil.impl.client.render.dynamicbuffer.VanillaShaderCompiler;
import foundry.veil.impl.glsl.grammar.GlslTypeSpecifier;
import foundry.veil.mixin.accessor.ReloadableResourceManagerAccessor;
import net.minecraft.ChatFormatting;
import net.minecraft.client.Minecraft;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
package foundry.veil.api.client.render.deferred;

import com.mojang.blaze3d.systems.RenderSystem;
import foundry.veil.Veil;
import foundry.veil.VeilClient;
import foundry.veil.api.client.render.VeilRenderSystem;
import foundry.veil.api.client.render.VeilRenderer;
import foundry.veil.api.client.render.deferred.light.renderer.LightRenderer;
import foundry.veil.api.client.render.framebuffer.AdvancedFbo;
import foundry.veil.api.client.render.framebuffer.FramebufferManager;
import foundry.veil.api.client.render.framebuffer.VeilFramebuffers;
import foundry.veil.api.client.render.post.PostPipeline;
import foundry.veil.api.client.render.post.PostProcessingManager;
import foundry.veil.api.client.render.shader.ShaderManager;
import foundry.veil.api.client.render.shader.definition.ShaderPreDefinitions;
import net.minecraft.ChatFormatting;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.components.toasts.SystemToast;
import net.minecraft.network.chat.Component;
Expand All @@ -27,10 +22,6 @@

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;
import java.util.function.Consumer;

import static org.lwjgl.opengl.GL11C.GL_DEPTH_BUFFER_BIT;
import static org.lwjgl.opengl.GL11C.GL_NEAREST;

/**
* <p>Handles mixing the regular deferred pipeline and the forward-rendered transparency pipeline.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public DirectionalLight setDirection(Vector3fc direction) {
* @param z The new z direction
*/
public DirectionalLight setDirection(float x, float y, float z) {
this.direction.set(x, y, z).normalize();
this.direction.set(x, y, z);
this.markDirty();
return this;
}
Expand Down Expand Up @@ -85,10 +85,7 @@ public void renderImGuiAttributes() {
float[] editDirection = new float[]{this.direction.x(), this.direction.y(), this.direction.z()};

if (ImGui.sliderFloat3("##direction", editDirection, -1.0F, 1.0F)) {
Vector3f vector = new Vector3f(editDirection).normalize();
if (!Float.isNaN(vector.x) && !Float.isNaN(vector.y) && !Float.isNaN(vector.z)) {
this.setDirection(vector);
}
this.setDirection(editDirection[0], editDirection[1], editDirection[2]);
}
ImGui.sameLine(0, ImGui.getStyle().getItemInnerSpacingX());
ImGui.text("direction");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
import foundry.veil.api.client.render.dynamicbuffer.DynamicBufferType;
import foundry.veil.api.client.render.framebuffer.AdvancedFbo;
import foundry.veil.api.client.render.shader.program.ShaderProgram;
import foundry.veil.impl.client.render.deferred.light.VanillaLightRenderer;
import foundry.veil.ext.LevelRendererExtension;
import foundry.veil.impl.client.render.dynamicbuffer.DynamicBufferManger;
import foundry.veil.impl.client.render.light.VanillaLightRenderer;
import net.minecraft.client.Minecraft;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
Expand All @@ -34,7 +35,6 @@ public class LightRenderer implements NativeResource {

private final Map<LightTypeRegistry.LightType<?>, LightData<?>> lights;

private VanillaLightRenderer vanillaLightRenderer;
private boolean ambientOcclusionEnabled;
private AdvancedFbo framebuffer;

Expand Down Expand Up @@ -154,7 +154,7 @@ public <T extends Light> List<T> getLights(LightTypeRegistry.LightType<? extends
public void enableAmbientOcclusion() {
if (!this.ambientOcclusionEnabled) {
this.ambientOcclusionEnabled = true;
Minecraft.getInstance().levelRenderer.allChanged();
((LevelRendererExtension) Minecraft.getInstance().levelRenderer).markChunksDirty();
}
}

Expand All @@ -164,7 +164,7 @@ public void enableAmbientOcclusion() {
public void disableAmbientOcclusion() {
if (this.ambientOcclusionEnabled) {
this.ambientOcclusionEnabled = false;
Minecraft.getInstance().levelRenderer.allChanged();
((LevelRendererExtension) Minecraft.getInstance().levelRenderer).markChunksDirty();
}
}

Expand All @@ -186,10 +186,6 @@ public boolean isAmbientOcclusionEnabled() {
public void free() {
this.lights.values().forEach(LightData::free);
this.lights.clear();
if (this.vanillaLightRenderer != null) {
this.vanillaLightRenderer.free();
this.vanillaLightRenderer = null;
}
}

@ApiStatus.Internal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@

import java.util.*;

import static org.lwjgl.opengl.GL30.GL_FRAMEBUFFER;
import static org.lwjgl.opengl.GL30.glBindFramebuffer;

/**
* <p>Manages all framebuffers and custom definitions specified in files.
* All framebuffers except for the main one can be customized from the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
package foundry.veil.api.client.render.rendertype.layer;

import com.mojang.serialization.Codec;
import com.mojang.serialization.DataResult;
import com.mojang.serialization.MapCodec;
import foundry.veil.api.client.registry.RenderTypeLayerRegistry;
import foundry.veil.api.client.render.rendertype.VeilRenderType;
import foundry.veil.api.client.render.rendertype.VeilRenderTypeBuilder;
import net.minecraft.client.renderer.RenderStateShard;

import java.util.Locale;

public record LightmapLayer(boolean enabled) implements RenderTypeLayer {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@

import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.serialization.Codec;
import com.mojang.serialization.DataResult;
import com.mojang.serialization.MapCodec;
import foundry.veil.Veil;
import foundry.veil.api.client.registry.RenderTypeLayerRegistry;
import foundry.veil.api.client.render.rendertype.VeilRenderType;
import foundry.veil.api.client.render.rendertype.VeilRenderTypeBuilder;
import net.minecraft.Util;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderStateShard;
import org.joml.Matrix4f;

import java.util.Locale;

public record TexturingLayer(float scale) implements RenderTypeLayer {

public static final MapCodec<TexturingLayer> CODEC = Codec.FLOAT.fieldOf("scale")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.objects.Object2IntArrayMap;
import it.unimi.dsi.fastutil.objects.Object2IntMap;
import net.minecraft.CrashReport;
import net.minecraft.CrashReportCategory;
import net.minecraft.ReportedException;
import net.minecraft.Util;
import net.minecraft.client.Minecraft;
import net.minecraft.resources.FileToIdConverter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import it.unimi.dsi.fastutil.objects.Object2IntMap;
import it.unimi.dsi.fastutil.objects.Object2IntMaps;
import net.minecraft.resources.ResourceLocation;
import org.jetbrains.annotations.Nullable;

import java.util.Collections;
import java.util.Set;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import foundry.veil.api.client.render.VeilRenderSystem;
import foundry.veil.api.client.render.deferred.light.PointLight;
import foundry.veil.api.client.render.deferred.light.renderer.LightRenderer;
import foundry.veil.api.quasar.emitters.module.RenderParticleModule;
import foundry.veil.api.quasar.emitters.module.UpdateParticleModule;
import foundry.veil.api.quasar.particle.QuasarParticle;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package foundry.veil.impl;

import foundry.veil.Veil;
import foundry.veil.api.client.render.deferred.VeilDeferredRenderer;
import net.minecraft.resources.ResourceLocation;
import org.jetbrains.annotations.ApiStatus;

Expand Down

This file was deleted.

Loading

0 comments on commit cd650bf

Please sign in to comment.