mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-24 06:04:27 +00:00
Custom images, textures, SSBO, and ShaderPack/ShaderProperties backports
This commit is contained in:
1 parent
6d60477b93
commit
bb52476d27
54 files changed
+2210
-494
No files matched your search
@@ -1,15 +1,16 @@
|
||||
package net.coderbot.iris.shaderpack.texture;
|
||||
|
||||
import lombok.Getter;
|
||||
import net.coderbot.iris.gl.texture.InternalTextureFormat;
|
||||
import net.coderbot.iris.gl.texture.PixelFormat;
|
||||
import net.coderbot.iris.gl.texture.PixelType;
|
||||
|
||||
public abstract class CustomTextureData {
|
||||
private CustomTextureData() {
|
||||
|
||||
CustomTextureData() {
|
||||
}
|
||||
|
||||
public static final class PngData extends CustomTextureData {
|
||||
@Getter
|
||||
public static final class PngData extends CustomTextureData {
|
||||
private final TextureFilteringData filteringData;
|
||||
private final byte[] content;
|
||||
|
||||
@@ -18,14 +19,7 @@ public abstract class CustomTextureData {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public TextureFilteringData getFilteringData() {
|
||||
return filteringData;
|
||||
}
|
||||
|
||||
public byte[] getContent() {
|
||||
return content;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static final class LightmapMarker extends CustomTextureData {
|
||||
@Override
|
||||
@@ -39,123 +33,80 @@ public abstract class CustomTextureData {
|
||||
}
|
||||
}
|
||||
|
||||
public static final class ResourceData extends CustomTextureData {
|
||||
private final String namespace;
|
||||
private final String location;
|
||||
@Getter
|
||||
public static final class ResourceData extends CustomTextureData {
|
||||
private final String namespace;
|
||||
private final String location;
|
||||
|
||||
public ResourceData(String namespace, String location) {
|
||||
this.namespace = namespace;
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The namespace of the texture. The caller is responsible for checking whether this is actually
|
||||
* a valid namespace.
|
||||
*/
|
||||
public String getNamespace() {
|
||||
return namespace;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The path / location of the texture. The caller is responsible for checking whether this is actually
|
||||
* a valid path.
|
||||
*/
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
public abstract static class RawData extends CustomTextureData {
|
||||
private final byte[] content;
|
||||
private final TextureFilteringData filteringData;
|
||||
private final InternalTextureFormat internalFormat;
|
||||
private final PixelFormat pixelFormat;
|
||||
private final PixelType pixelType;
|
||||
|
||||
private RawData(byte[] content, InternalTextureFormat internalFormat,
|
||||
PixelFormat pixelFormat, PixelType pixelType) {
|
||||
protected RawData(byte[] content, TextureFilteringData filteringData, InternalTextureFormat internalFormat, PixelFormat pixelFormat, PixelType pixelType) {
|
||||
this.content = content;
|
||||
this.filteringData = filteringData;
|
||||
this.internalFormat = internalFormat;
|
||||
this.pixelFormat = pixelFormat;
|
||||
this.pixelType = pixelType;
|
||||
}
|
||||
|
||||
public final byte[] getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public final InternalTextureFormat getInternalFormat() {
|
||||
return internalFormat;
|
||||
}
|
||||
|
||||
public final PixelFormat getPixelFormat() {
|
||||
return pixelFormat;
|
||||
}
|
||||
|
||||
public final PixelType getPixelType() {
|
||||
return pixelType;
|
||||
}
|
||||
}
|
||||
|
||||
public static final class RawData1D extends RawData {
|
||||
@Getter
|
||||
public static final class RawData1D extends RawData {
|
||||
private final int sizeX;
|
||||
|
||||
private RawData1D(byte[] content, InternalTextureFormat internalFormat,
|
||||
PixelFormat pixelFormat, PixelType pixelType, int sizeX) {
|
||||
super(content, internalFormat, pixelFormat, pixelType);
|
||||
public RawData1D(byte[] content, TextureFilteringData filteringData, InternalTextureFormat internalFormat, PixelFormat pixelFormat, PixelType pixelType, int sizeX) {
|
||||
super(content, filteringData, internalFormat, pixelFormat, pixelType);
|
||||
|
||||
this.sizeX = sizeX;
|
||||
}
|
||||
|
||||
public int getSizeX() {
|
||||
return sizeX;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static final class RawData2D extends RawData {
|
||||
int sizeX;
|
||||
int sizeY;
|
||||
@Getter
|
||||
public static class RawData2D extends RawData {
|
||||
private final int sizeX;
|
||||
private final int sizeY;
|
||||
|
||||
private RawData2D(byte[] content, InternalTextureFormat internalFormat,
|
||||
PixelFormat pixelFormat, PixelType pixelType, int sizeX, int sizeY) {
|
||||
super(content, internalFormat, pixelFormat, pixelType);
|
||||
public RawData2D(byte[] content, TextureFilteringData filteringData, InternalTextureFormat internalFormat, PixelFormat pixelFormat, PixelType pixelType, int sizeX, int sizeY) {
|
||||
super(content, filteringData, internalFormat, pixelFormat, pixelType);
|
||||
|
||||
this.sizeX = sizeX;
|
||||
this.sizeY = sizeY;
|
||||
}
|
||||
|
||||
public int getSizeX() {
|
||||
return sizeX;
|
||||
}
|
||||
}
|
||||
|
||||
public int getSizeY() {
|
||||
return sizeY;
|
||||
}
|
||||
}
|
||||
@Getter
|
||||
public static final class RawData3D extends RawData {
|
||||
private final int sizeX;
|
||||
private final int sizeY;
|
||||
private final int sizeZ;
|
||||
|
||||
public static final class RawData3D extends RawData {
|
||||
int sizeX;
|
||||
int sizeY;
|
||||
int sizeZ;
|
||||
|
||||
private RawData3D(byte[] content, InternalTextureFormat internalFormat,
|
||||
PixelFormat pixelFormat, PixelType pixelType, int sizeX, int sizeY, int sizeZ) {
|
||||
super(content, internalFormat, pixelFormat, pixelType);
|
||||
public RawData3D(byte[] content, TextureFilteringData filteringData, InternalTextureFormat internalFormat, PixelFormat pixelFormat, PixelType pixelType, int sizeX, int sizeY, int sizeZ) {
|
||||
super(content, filteringData, internalFormat, pixelFormat, pixelType);
|
||||
|
||||
this.sizeX = sizeX;
|
||||
this.sizeY = sizeY;
|
||||
this.sizeZ = sizeZ;
|
||||
}
|
||||
|
||||
public int getSizeX() {
|
||||
return sizeX;
|
||||
}
|
||||
}
|
||||
|
||||
public int getSizeY() {
|
||||
return sizeY;
|
||||
}
|
||||
|
||||
public int getSizeZ() {
|
||||
return sizeZ;
|
||||
public static final class RawDataRect extends RawData2D {
|
||||
public RawDataRect(byte[] content, TextureFilteringData filteringData, InternalTextureFormat internalFormat, PixelFormat pixelFormat, PixelType pixelType, int sizeX, int sizeY) {
|
||||
super(content, filteringData, internalFormat, pixelFormat, pixelType, sizeX, sizeY);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user