本文整理汇总了Java中net.minecraft.client.shader.ShaderGroup类的典型用法代码示例。如果您正苦于以下问题:Java ShaderGroup类的具体用法?Java ShaderGroup怎么用?Java ShaderGroup使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ShaderGroup类属于net.minecraft.client.shader包,在下文中一共展示了ShaderGroup类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadShader
import net.minecraft.client.shader.ShaderGroup; //导入依赖的package包/类
private void loadShader(ResourceLocation resourceLocationIn)
{
try
{
this.theShaderGroup = new ShaderGroup(this.mc.getTextureManager(), this.resourceManager, this.mc.getFramebuffer(), resourceLocationIn);
this.theShaderGroup.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight);
this.useShader = true;
}
catch (IOException ioexception)
{
logger.warn((String)("Failed to load shader: " + resourceLocationIn), (Throwable)ioexception);
this.shaderIndex = shaderCount;
this.useShader = false;
}
catch (JsonSyntaxException jsonsyntaxexception)
{
logger.warn((String)("Failed to load shader: " + resourceLocationIn), (Throwable)jsonsyntaxexception);
this.shaderIndex = shaderCount;
this.useShader = false;
}
}
示例2: loadShader
import net.minecraft.client.shader.ShaderGroup; //导入依赖的package包/类
public void loadShader(ResourceLocation resourceLocationIn)
{
if (OpenGlHelper.isFramebufferEnabled())
{
try
{
this.theShaderGroup = new ShaderGroup(this.mc.getTextureManager(), this.resourceManager, this.mc.getFramebuffer(), resourceLocationIn);
this.theShaderGroup.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight);
this.useShader = true;
}
catch (IOException ioexception)
{
logger.warn((String)("Failed to load shader: " + resourceLocationIn), (Throwable)ioexception);
this.shaderIndex = shaderCount;
this.useShader = false;
}
catch (JsonSyntaxException jsonsyntaxexception)
{
logger.warn((String)("Failed to load shader: " + resourceLocationIn), (Throwable)jsonsyntaxexception);
this.shaderIndex = shaderCount;
this.useShader = false;
}
}
}
示例3: loadShader
import net.minecraft.client.shader.ShaderGroup; //导入依赖的package包/类
private void loadShader(ResourceLocation resourceLocationIn) {
try {
this.theShaderGroup = new ShaderGroup(this.mc.getTextureManager(), this.resourceManager,
this.mc.getFramebuffer(), resourceLocationIn);
this.theShaderGroup.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight);
this.useShader = true;
} catch (IOException ioexception) {
logger.warn((String) ("Failed to load shader: " + resourceLocationIn), (Throwable) ioexception);
this.shaderIndex = shaderCount;
this.useShader = false;
} catch (JsonSyntaxException jsonsyntaxexception) {
logger.warn((String) ("Failed to load shader: " + resourceLocationIn), (Throwable) jsonsyntaxexception);
this.shaderIndex = shaderCount;
this.useShader = false;
}
}
示例4: loadShader
import net.minecraft.client.shader.ShaderGroup; //导入依赖的package包/类
public void loadShader(ResourceLocation resourceLocationIn)
{
if (OpenGlHelper.isFramebufferEnabled())
{
try
{
this.theShaderGroup = new ShaderGroup(this.mc.getTextureManager(), this.resourceManager, this.mc.getFramebuffer(), resourceLocationIn);
this.theShaderGroup.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight);
this.useShader = true;
}
catch (IOException ioexception)
{
LOGGER.warn("Failed to load shader: {}", new Object[] {resourceLocationIn, ioexception});
this.shaderIndex = SHADER_COUNT;
this.useShader = false;
}
catch (JsonSyntaxException jsonsyntaxexception)
{
LOGGER.warn("Failed to load shader: {}", new Object[] {resourceLocationIn, jsonsyntaxexception});
this.shaderIndex = SHADER_COUNT;
this.useShader = false;
}
}
}
示例5: loadShader
import net.minecraft.client.shader.ShaderGroup; //导入依赖的package包/类
public void loadShader(ResourceLocation resourceLocationIn)
{
try
{
this.theShaderGroup = new ShaderGroup(this.mc.getTextureManager(), this.resourceManager, this.mc.getFramebuffer(), resourceLocationIn);
this.theShaderGroup.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight);
this.useShader = true;
}
catch (IOException ioexception)
{
LOGGER.warn("Failed to load shader: {}", new Object[] {resourceLocationIn, ioexception});
this.shaderIndex = SHADER_COUNT;
this.useShader = false;
}
catch (JsonSyntaxException jsonsyntaxexception)
{
LOGGER.warn("Failed to load shader: {}", new Object[] {resourceLocationIn, jsonsyntaxexception});
this.shaderIndex = SHADER_COUNT;
this.useShader = false;
}
}
示例6: activateBatch
import net.minecraft.client.shader.ShaderGroup; //导入依赖的package包/类
public void activateBatch()
{
if(batch != null)
{
if(OpenGlHelper.shadersSupported)
{
try
{
ShaderGroup theShaderGroup = batch.toShaderGroup(resManager);
theShaderGroup.createBindFramebuffers(Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight);
ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, theShaderGroup, 51);
ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, true, 55);
}
catch(JsonException e)
{
e.printStackTrace();
}
}
}
}
示例7: onResourceManagerReload
import net.minecraft.client.shader.ShaderGroup; //导入依赖的package包/类
public void onResourceManagerReload(IResourceManager par1ResourceManager)
{
if (this.theShaderGroup != null)
{
this.theShaderGroup.deleteShaderGroup();
}
if (this.shaderIndex != shaderCount)
{
try
{
this.theShaderGroup = new ShaderGroup(par1ResourceManager, this.mc.getFramebuffer(), shaderResourceLocations[this.shaderIndex]);
this.theShaderGroup.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight);
}
catch (IOException var3)
{
logger.warn("Failed to load shader: " + shaderResourceLocations[this.shaderIndex], var3);
this.shaderIndex = shaderCount;
}
}
}
示例8: enableGrayscaleShader
import net.minecraft.client.shader.ShaderGroup; //导入依赖的package包/类
@Override
public void enableGrayscaleShader() {
if (OpenGlHelper.shadersSupported) {
Minecraft mc = Minecraft.getMinecraft();
EntityRenderer entityRenderer = mc.entityRenderer;
if (entityRenderer.theShaderGroup != null) {
entityRenderer.theShaderGroup.deleteShaderGroup();
}
try {
entityRenderer.theShaderGroup = new ShaderGroup(mc.getTextureManager(), mc.getResourceManager(), mc.getFramebuffer(), this.shader);
entityRenderer.theShaderGroup.createBindFramebuffers(mc.displayWidth, mc.displayHeight);
} catch (IOException ioexception) {
Corruption.logger.warn("Failed to load shader: ", ioexception);
}
}
}
示例9: onResourceManagerReload
import net.minecraft.client.shader.ShaderGroup; //导入依赖的package包/类
public void onResourceManagerReload(IResourceManager p_110549_1_)
{
if (this.theShaderGroup != null)
{
this.theShaderGroup.deleteShaderGroup();
}
if (this.shaderIndex != shaderCount)
{
try
{
this.theShaderGroup = new ShaderGroup(this.mc.getTextureManager(), p_110549_1_, this.mc.getFramebuffer(), shaderResourceLocations[this.shaderIndex]);
this.theShaderGroup.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight);
}
catch (IOException ioexception)
{
logger.warn("Failed to load shader: " + shaderResourceLocations[this.shaderIndex], ioexception);
this.shaderIndex = shaderCount;
}
}
}
示例10: activateKongaShader
import net.minecraft.client.shader.ShaderGroup; //导入依赖的package包/类
private static void activateKongaShader()
{
EntityRenderer renderer = Minecraft.getMinecraft().entityRenderer;
if (OpenGlHelper.shadersSupported)
{
if (renderer.theShaderGroup != null)
{
renderer.theShaderGroup.deleteShaderGroup();
}
try
{
LogHelper.info("Selecting effect " + shader);
renderer.theShaderGroup = new ShaderGroup(Minecraft.getMinecraft().getTextureManager(), Minecraft.getMinecraft().getResourceManager(), Minecraft.getMinecraft().getFramebuffer(), shader);
renderer.theShaderGroup.createBindFramebuffers(Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight);
} catch (Exception e)
{
e.printStackTrace();
LogHelper.warning("Failed to load shader: " + shader);
}
}
}
示例11: makeEntityOutlineShader
import net.minecraft.client.shader.ShaderGroup; //导入依赖的package包/类
/**
* Creates the entity outline shader to be stored in RenderGlobal.entityOutlineShader
*/
public void makeEntityOutlineShader()
{
if (OpenGlHelper.shadersSupported)
{
if (ShaderLinkHelper.getStaticShaderLinkHelper() == null)
{
ShaderLinkHelper.setNewStaticShaderLinkHelper();
}
ResourceLocation resourcelocation = new ResourceLocation("shaders/post/entity_outline.json");
try
{
this.entityOutlineShader = new ShaderGroup(this.mc.getTextureManager(), this.mc.getResourceManager(), this.mc.getFramebuffer(), resourcelocation);
this.entityOutlineShader.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight);
this.entityOutlineFramebuffer = this.entityOutlineShader.getFramebufferRaw("final");
}
catch (IOException ioexception)
{
logger.warn((String)("Failed to load shader: " + resourcelocation), (Throwable)ioexception);
this.entityOutlineShader = null;
this.entityOutlineFramebuffer = null;
}
catch (JsonSyntaxException jsonsyntaxexception)
{
logger.warn((String)("Failed to load shader: " + resourcelocation), (Throwable)jsonsyntaxexception);
this.entityOutlineShader = null;
this.entityOutlineFramebuffer = null;
}
}
else
{
this.entityOutlineShader = null;
this.entityOutlineFramebuffer = null;
}
}
示例12: makeEntityOutlineShader
import net.minecraft.client.shader.ShaderGroup; //导入依赖的package包/类
/**
* Creates the entity outline shader to be stored in RenderGlobal.entityOutlineShader
*/
public void makeEntityOutlineShader()
{
if (OpenGlHelper.shadersSupported)
{
if (ShaderLinkHelper.getStaticShaderLinkHelper() == null)
{
ShaderLinkHelper.setNewStaticShaderLinkHelper();
}
ResourceLocation resourcelocation = new ResourceLocation("shaders/post/entity_outline.json");
try
{
this.entityOutlineShader = new ShaderGroup(this.mc.getTextureManager(), this.mc.getResourceManager(), this.mc.getFramebuffer(), resourcelocation);
this.entityOutlineShader.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight);
this.entityOutlineFramebuffer = this.entityOutlineShader.getFramebufferRaw("final");
}
catch (IOException ioexception)
{
LOGGER.warn("Failed to load shader: {}", new Object[] {resourcelocation, ioexception});
this.entityOutlineShader = null;
this.entityOutlineFramebuffer = null;
}
catch (JsonSyntaxException jsonsyntaxexception)
{
LOGGER.warn("Failed to load shader: {}", new Object[] {resourcelocation, jsonsyntaxexception});
this.entityOutlineShader = null;
this.entityOutlineFramebuffer = null;
}
}
else
{
this.entityOutlineShader = null;
this.entityOutlineFramebuffer = null;
}
}
示例13: activateNextShader
import net.minecraft.client.shader.ShaderGroup; //导入依赖的package包/类
public void activateNextShader() throws IOException
{
if (OpenGlHelper.shadersSupported)
{
if (this.theShaderGroup != null) {
this.theShaderGroup.deleteShaderGroup();
}
this.shaderIndex = ((this.shaderIndex + 1) % (shaderResourceLocations.length + 1));
if (this.shaderIndex != shaderCount)
{
try
{
logger.info("Selecting effect " + shaderResourceLocations[this.shaderIndex]);
this.theShaderGroup = new ShaderGroup(this.mc.getTextureManager(), this.resourceManager, this.mc.getFramebuffer(), shaderResourceLocations[this.shaderIndex]);
this.theShaderGroup.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight);
}
catch (JsonSyntaxException jsonsyntaxexception)
{
logger.warn("Failed to load shader: " + shaderResourceLocations[this.shaderIndex], jsonsyntaxexception);
this.shaderIndex = shaderCount;
}
}
else
{
this.theShaderGroup = null;
logger.info("No effect selected");
}
}
}
示例14: activateNextShader
import net.minecraft.client.shader.ShaderGroup; //导入依赖的package包/类
public void activateNextShader()
{
if (OpenGlHelper.shadersSupported)
{
if (this.theShaderGroup != null)
{
this.theShaderGroup.deleteShaderGroup();
}
this.shaderIndex = (this.shaderIndex + 1) % (shaderResourceLocations.length + 1);
if (this.shaderIndex != shaderCount)
{
try
{
logger.info("Selecting effect " + shaderResourceLocations[this.shaderIndex]);
this.theShaderGroup = new ShaderGroup(this.resourceManager, this.mc.getFramebuffer(), shaderResourceLocations[this.shaderIndex]);
this.theShaderGroup.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight);
}
catch (IOException var2)
{
logger.warn("Failed to load shader: " + shaderResourceLocations[this.shaderIndex], var2);
this.shaderIndex = shaderCount;
}
catch (JsonSyntaxException var3)
{
logger.warn("Failed to load shader: " + shaderResourceLocations[this.shaderIndex], var3);
this.shaderIndex = shaderCount;
}
}
else
{
this.theShaderGroup = null;
logger.info("No effect selected");
}
}
}
示例15: activateNextShader
import net.minecraft.client.shader.ShaderGroup; //导入依赖的package包/类
public void activateNextShader()
{
if (OpenGlHelper.shadersSupported)
{
if (this.theShaderGroup != null)
{
this.theShaderGroup.deleteShaderGroup();
}
this.shaderIndex = (this.shaderIndex + 1) % (shaderResourceLocations.length + 1);
if (this.shaderIndex != shaderCount)
{
try
{
logger.info("Selecting effect " + shaderResourceLocations[this.shaderIndex]);
this.theShaderGroup = new ShaderGroup(this.mc.getTextureManager(), this.resourceManager, this.mc.getFramebuffer(), shaderResourceLocations[this.shaderIndex]);
this.theShaderGroup.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight);
}
catch (IOException ioexception)
{
logger.warn("Failed to load shader: " + shaderResourceLocations[this.shaderIndex], ioexception);
this.shaderIndex = shaderCount;
}
catch (JsonSyntaxException jsonsyntaxexception)
{
logger.warn("Failed to load shader: " + shaderResourceLocations[this.shaderIndex], jsonsyntaxexception);
this.shaderIndex = shaderCount;
}
}
else
{
this.theShaderGroup = null;
logger.info("No effect selected");
}
}
}