java.lang.Object
net.minecraft.client.renderer.texture.AbstractTexture
net.minecraft.client.renderer.texture.SimpleTexture
com.pixelmonmod.pixelmon.client.materials.Cubemap
All Implemented Interfaces:
AutoCloseable

public class Cubemap extends net.minecraft.client.renderer.texture.SimpleTexture
Cubemaps draw simulated reflections via a texture. The width:height ratio of an image must be exactly 3:4 to be used as a cubemap. Cubemaps currently override standard textures completely: if a model that normally has a regular texture applied to it starts a cubemap, the regular texture will not be used.
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraft.client.renderer.texture.SimpleTexture

    net.minecraft.client.renderer.texture.SimpleTexture.TextureImage
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final ByteBuffer[]
     
    protected static HashMap<net.minecraft.resources.ResourceLocation,Cubemap>
     
    int
     
    final net.minecraft.resources.ResourceLocation
     
    int
     
    int
     

    Fields inherited from class net.minecraft.client.renderer.texture.SimpleTexture

    location

    Fields inherited from class net.minecraft.client.renderer.texture.AbstractTexture

    blur, id, mipmap, NOT_ASSIGNED
  • Constructor Summary

    Constructors
    Constructor
    Description
    Cubemap(net.minecraft.resources.ResourceLocation resLoc)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    begin(net.minecraft.resources.ResourceLocation resLoc)
    runs the OpenGL that enables the cubemap.
    static void
    debugResourceStuff(net.minecraft.resources.ResourceLocation resLoc)
     
    void
    end()
    Performs the necessary steps to ensure that the next thing rendered does not also have a CubeMap applied to it, assuming it isn't supposed to.
    protected void
    initBuffers(BufferedImage fullImg, String fileLoc)
     
    protected void
     
    void
     
     

    Methods inherited from class net.minecraft.client.renderer.texture.SimpleTexture

    getTextureImage, load

    Methods inherited from class net.minecraft.client.renderer.texture.AbstractTexture

    bind, close, getId, releaseId, reset, restoreLastBlurMipmap, setBlurMipmap, setFilter

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • sqr

      public int sqr
    • width

      public int width
    • height

      public int height
    • buffers

      public final ByteBuffer[] buffers
    • cubemaps

      protected static HashMap<net.minecraft.resources.ResourceLocation,Cubemap> cubemaps
    • resourceLoc

      public final net.minecraft.resources.ResourceLocation resourceLoc
  • Constructor Details

    • Cubemap

      public Cubemap(net.minecraft.resources.ResourceLocation resLoc) throws IOException
      Parameters:
      resLoc - A ResourceLocation denoting the location of the Image file.
      Throws:
      IOException - If the file could not be found, or if the width-to-height ratio is not 3:4
  • Method Details

    • initBuffers

      protected void initBuffers(BufferedImage fullImg, String fileLoc) throws IOException
      Throws:
      IOException
    • begin

      public static void begin(net.minecraft.resources.ResourceLocation resLoc)
      runs the OpenGL that enables the cubemap. this will do nothing if "advanced OpenGL" is disabled. This should be run before rendering anything to be cubemapped, then Cubemap.end() should be called to disable the cubemap, otherwise everything on the screen will be cubemapped!
      Parameters:
      resLoc - - the name of the cubemap, this would be the same name that was used in "preloadCubemap"
    • newBinding

      protected void newBinding()
    • start

      public void start()
    • end

      public void end()
      Performs the necessary steps to ensure that the next thing rendered does not also have a CubeMap applied to it, assuming it isn't supposed to.
    • debugResourceStuff

      public static void debugResourceStuff(net.minecraft.resources.ResourceLocation resLoc)
    • toString

      public String toString()
      Overrides:
      toString in class Object