Class ManagedSamplerUniformBase

java.lang.Object
dev.cammiescorner.velvet.impl.ManagedUniformBase
dev.cammiescorner.velvet.impl.ManagedSamplerUniformBase
All Implemented Interfaces:
SamplerUniform
Direct Known Subclasses:
ManagedSamplerUniformV1, ManagedSamplerUniformV2

public abstract class ManagedSamplerUniformBase extends ManagedUniformBase implements SamplerUniform
Mojank working in divergent branches for half a century, ShaderInstance is a copy of an old implementation of EffectInstance. The latter has since been updated to have the EffectInstance.setSampler(String, IntSupplier) while the former still uses ShaderInstance.setSampler(String, Object).

So we need to deal with both those extremely similar implementations

  • Field Details

    • targets

      protected SamplerAccess[] targets
    • locations

      protected int[] locations
    • cachedValue

      protected Object cachedValue
  • Constructor Details

    • ManagedSamplerUniformBase

      public ManagedSamplerUniformBase(String name)
  • Method Details

    • findUniformTargets

      public boolean findUniformTargets(List<net.minecraft.client.renderer.PostPass> shaders)
      Specified by:
      findUniformTargets in class ManagedUniformBase
    • findUniformTarget

      public boolean findUniformTarget(net.minecraft.client.renderer.ShaderInstance shader)
      Specified by:
      findUniformTarget in class ManagedUniformBase
    • set

      protected abstract void set(Object value)
    • setDirect

      public void setDirect(int activeTexture)
      Description copied from interface: SamplerUniform
      Sets the value of a sampler uniform declared in json using the Opengl texture slot id (between 0 and 30).
      Specified by:
      setDirect in interface SamplerUniform
      Parameters:
      activeTexture - the active texture id to be used by the sampler
      See Also:
      • GL13.GL_TEXTURE0