mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-11-10 12:34:11 +01:00
Move diffuse declaration to vertex compiler
This commit is contained in:
parent
20a75321e2
commit
52f66dec9d
@ -1,13 +1,18 @@
|
||||
package com.jozufozu.flywheel.core;
|
||||
|
||||
import com.jozufozu.flywheel.Flywheel;
|
||||
import com.jozufozu.flywheel.backend.gl.GLSLVersion;
|
||||
import com.jozufozu.flywheel.core.compile.FragmentTemplateData;
|
||||
import com.jozufozu.flywheel.core.compile.InstancingTemplateData;
|
||||
import com.jozufozu.flywheel.core.compile.OneShotTemplateData;
|
||||
import com.jozufozu.flywheel.core.compile.Template;
|
||||
import com.jozufozu.flywheel.core.source.FileResolution;
|
||||
import com.jozufozu.flywheel.core.source.Resolver;
|
||||
|
||||
public class Templates {
|
||||
|
||||
public static final FileResolution DIFFUSE_FILE = Resolver.INSTANCE.get(Flywheel.rl("core/diffuse.glsl"));
|
||||
|
||||
public static final Template<InstancingTemplateData> INSTANCING = new Template<>(GLSLVersion.V330, InstancingTemplateData::new);
|
||||
public static final Template<OneShotTemplateData> ONE_SHOT = new Template<>(GLSLVersion.V150, OneShotTemplateData::new);
|
||||
public static final Template<FragmentTemplateData> FRAGMENT = new Template<>(GLSLVersion.V150, FragmentTemplateData::new);
|
||||
|
@ -5,6 +5,7 @@ import java.util.Objects;
|
||||
import com.jozufozu.flywheel.api.vertex.VertexType;
|
||||
import com.jozufozu.flywheel.backend.gl.shader.GlShader;
|
||||
import com.jozufozu.flywheel.backend.gl.shader.ShaderType;
|
||||
import com.jozufozu.flywheel.core.Templates;
|
||||
import com.jozufozu.flywheel.core.shader.StateSnapshot;
|
||||
import com.jozufozu.flywheel.core.source.FileIndexImpl;
|
||||
import com.jozufozu.flywheel.core.source.FileResolution;
|
||||
@ -40,6 +41,7 @@ public class VertexCompiler extends Memoizer<VertexCompiler.Context, GlShader> {
|
||||
|
||||
FileIndexImpl index = new FileIndexImpl();
|
||||
|
||||
Templates.DIFFUSE_FILE.getFile().generateFinalSource(index, finalSource);
|
||||
header.getFile().generateFinalSource(index, finalSource);
|
||||
|
||||
key.file.generateFinalSource(index, finalSource);
|
||||
|
@ -1,15 +0,0 @@
|
||||
package com.jozufozu.flywheel.util;
|
||||
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
|
||||
/**
|
||||
* This is a silly hack that's needed because flywheel does things too different from vanilla.
|
||||
*
|
||||
* <p>
|
||||
* When a {@link RenderType} is setup, the associated textures are "bound" within RenderSystem, but not actually
|
||||
* bound via opengl. This class provides a helper function to forward the bindings to opengl.
|
||||
* </p>
|
||||
*/
|
||||
public class TextureBinder {
|
||||
|
||||
}
|
@ -1,5 +1,4 @@
|
||||
#use "flywheel:context/fog.glsl"
|
||||
#use "flywheel:core/diffuse.glsl"
|
||||
|
||||
uniform float uTime;
|
||||
uniform mat4 uViewProjection;
|
||||
|
@ -1,5 +1,4 @@
|
||||
#use "flywheel:context/fog.glsl"
|
||||
#use "flywheel:core/diffuse.glsl"
|
||||
|
||||
uniform float uTime;
|
||||
uniform mat4 uViewProjection;
|
||||
|
Loading…
Reference in New Issue
Block a user