当前位置: 首页>>代码示例>>Java>>正文


Java ShaderGroup类代码示例

本文整理汇总了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;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:22,代码来源:EntityRenderer.java

示例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;
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:25,代码来源:EntityRenderer.java

示例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;
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:17,代码来源:EntityRenderer.java

示例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;
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:25,代码来源:EntityRenderer.java

示例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;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:22,代码来源:EntityRenderer.java

示例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();
            }
        }
    }
}
 
开发者ID:jglrxavpok,项目名称:ShadyMod,代码行数:21,代码来源:ShadyMod.java

示例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;
        }
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:22,代码来源:EntityRenderer.java

示例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);
        }
    }
}
 
开发者ID:kihira,项目名称:Corruption,代码行数:18,代码来源:ClientProxy.java

示例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;
        }
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:22,代码来源:EntityRenderer.java

示例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);
        }
    }
}
 
开发者ID:Dynious,项目名称:RefinedRelocation,代码行数:23,代码来源:KongaHandler.java

示例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;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:40,代码来源:RenderGlobal.java

示例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;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:40,代码来源:RenderGlobal.java

示例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");
		}
	}
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:30,代码来源:EntityRenderer.java

示例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");
        }
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:38,代码来源:EntityRenderer.java

示例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");
        }
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:38,代码来源:EntityRenderer.java


注:本文中的net.minecraft.client.shader.ShaderGroup类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。