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


Java ShaderLinkHelper.setNewStaticShaderLinkHelper方法代码示例

本文整理汇总了Java中net.minecraft.client.shader.ShaderLinkHelper.setNewStaticShaderLinkHelper方法的典型用法代码示例。如果您正苦于以下问题:Java ShaderLinkHelper.setNewStaticShaderLinkHelper方法的具体用法?Java ShaderLinkHelper.setNewStaticShaderLinkHelper怎么用?Java ShaderLinkHelper.setNewStaticShaderLinkHelper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.client.shader.ShaderLinkHelper的用法示例。

在下文中一共展示了ShaderLinkHelper.setNewStaticShaderLinkHelper方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: makeEntityOutlineShader

import net.minecraft.client.shader.ShaderLinkHelper; //导入方法依赖的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


示例2: makeEntityOutlineShader

import net.minecraft.client.shader.ShaderLinkHelper; //导入方法依赖的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


示例3: updateRenderer

import net.minecraft.client.shader.ShaderLinkHelper; //导入方法依赖的package包/类
/**
 * Updates the entity renderer
 */
public void updateRenderer()
{
    if (OpenGlHelper.shadersSupported && ShaderLinkHelper.getStaticShaderLinkHelper() == null)
    {
        ShaderLinkHelper.setNewStaticShaderLinkHelper();
    }

    this.updateFovModifierHand();
    this.updateTorchFlicker();
    this.fogColor2 = this.fogColor1;
    this.thirdPersonDistanceTemp = this.thirdPersonDistance;

    if (this.mc.gameSettings.smoothCamera)
    {
        float f = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F;
        float f1 = f * f * f * 8.0F;
        this.smoothCamFilterX = this.mouseFilterXAxis.smooth(this.smoothCamYaw, 0.05F * f1);
        this.smoothCamFilterY = this.mouseFilterYAxis.smooth(this.smoothCamPitch, 0.05F * f1);
        this.smoothCamPartialTicks = 0.0F;
        this.smoothCamYaw = 0.0F;
        this.smoothCamPitch = 0.0F;
    }
    else
    {
        this.smoothCamFilterX = 0.0F;
        this.smoothCamFilterY = 0.0F;
        this.mouseFilterXAxis.reset();
        this.mouseFilterYAxis.reset();
    }

    if (this.mc.getRenderViewEntity() == null)
    {
        this.mc.setRenderViewEntity(this.mc.thePlayer);
    }

    float f3 = this.mc.theWorld.getLightBrightness(new BlockPos(this.mc.getRenderViewEntity()));
    float f4 = (float)this.mc.gameSettings.renderDistanceChunks / 32.0F;
    float f2 = f3 * (1.0F - f4) + f4;
    this.fogColor1 += (f2 - this.fogColor1) * 0.1F;
    ++this.rendererUpdateCount;
    this.itemRenderer.updateEquippedItem();
    this.addRainParticles();
    this.bossColorModifierPrev = this.bossColorModifier;

    if (BossStatus.hasColorModifier)
    {
        this.bossColorModifier += 0.05F;

        if (this.bossColorModifier > 1.0F)
        {
            this.bossColorModifier = 1.0F;
        }

        BossStatus.hasColorModifier = false;
    }
    else if (this.bossColorModifier > 0.0F)
    {
        this.bossColorModifier -= 0.0125F;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:64,代码来源:EntityRenderer.java


示例4: updateRenderer

import net.minecraft.client.shader.ShaderLinkHelper; //导入方法依赖的package包/类
/**
 * Updates the entity renderer
 */
public void updateRenderer()
{
    if (OpenGlHelper.shadersSupported && ShaderLinkHelper.getStaticShaderLinkHelper() == null)
    {
        ShaderLinkHelper.setNewStaticShaderLinkHelper();
    }

    this.updateFovModifierHand();
    this.updateTorchFlicker();
    this.fogColor2 = this.fogColor1;
    this.thirdPersonDistanceTemp = this.thirdPersonDistance;

    if (this.mc.gameSettings.smoothCamera)
    {
        float f = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F;
        float f1 = f * f * f * 8.0F;
        this.smoothCamFilterX = this.mouseFilterXAxis.smooth(this.smoothCamYaw, 0.05F * f1);
        this.smoothCamFilterY = this.mouseFilterYAxis.smooth(this.smoothCamPitch, 0.05F * f1);
        this.smoothCamPartialTicks = 0.0F;
        this.smoothCamYaw = 0.0F;
        this.smoothCamPitch = 0.0F;
    }
    else
    {
        this.smoothCamFilterX = 0.0F;
        this.smoothCamFilterY = 0.0F;
        this.mouseFilterXAxis.reset();
        this.mouseFilterYAxis.reset();
    }

    if (this.mc.getRenderViewEntity() == null)
    {
        this.mc.setRenderViewEntity(this.mc.thePlayer);
    }

    Entity entity = this.mc.getRenderViewEntity();
    double d0 = entity.posX;
    double d1 = entity.posY + (double)entity.getEyeHeight();
    double d2 = entity.posZ;
    float f3 = this.mc.theWorld.getLightBrightness(new BlockPos(d0, d1, d2));
    float f4 = (float)this.mc.gameSettings.renderDistanceChunks / 16.0F;
    f4 = MathHelper.clamp_float(f4, 0.0F, 1.0F);
    float f2 = f3 * (1.0F - f4) + f4;
    this.fogColor1 += (f2 - this.fogColor1) * 0.1F;
    ++this.rendererUpdateCount;
    this.itemRenderer.updateEquippedItem();
    this.addRainParticles();
    this.bossColorModifierPrev = this.bossColorModifier;

    if (BossStatus.hasColorModifier)
    {
        this.bossColorModifier += 0.05F;

        if (this.bossColorModifier > 1.0F)
        {
            this.bossColorModifier = 1.0F;
        }

        BossStatus.hasColorModifier = false;
    }
    else if (this.bossColorModifier > 0.0F)
    {
        this.bossColorModifier -= 0.0125F;
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:69,代码来源:EntityRenderer.java


示例5: updateRenderer

import net.minecraft.client.shader.ShaderLinkHelper; //导入方法依赖的package包/类
/**
 * Updates the entity renderer
 */
public void updateRenderer() {
	if (OpenGlHelper.shadersSupported && ShaderLinkHelper.getStaticShaderLinkHelper() == null) {
		ShaderLinkHelper.setNewStaticShaderLinkHelper();
	}

	this.updateFovModifierHand();
	this.updateTorchFlicker();
	this.fogColor2 = this.fogColor1;
	this.thirdPersonDistanceTemp = this.thirdPersonDistance;

	if (this.mc.gameSettings.smoothCamera) {
		float f = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F;
		float f1 = f * f * f * 8.0F;
		this.smoothCamFilterX = this.mouseFilterXAxis.smooth(this.smoothCamYaw, 0.05F * f1);
		this.smoothCamFilterY = this.mouseFilterYAxis.smooth(this.smoothCamPitch, 0.05F * f1);
		this.smoothCamPartialTicks = 0.0F;
		this.smoothCamYaw = 0.0F;
		this.smoothCamPitch = 0.0F;
	} else {
		this.smoothCamFilterX = 0.0F;
		this.smoothCamFilterY = 0.0F;
		this.mouseFilterXAxis.reset();
		this.mouseFilterYAxis.reset();
	}

	if (this.mc.getRenderViewEntity() == null) {
		this.mc.setRenderViewEntity(this.mc.thePlayer);
	}

	float f3 = this.mc.theWorld.getLightBrightness(new BlockPos(this.mc.getRenderViewEntity()));
	float f4 = (float) this.mc.gameSettings.renderDistanceChunks / 32.0F;
	float f2 = f3 * (1.0F - f4) + f4;
	this.fogColor1 += (f2 - this.fogColor1) * 0.1F;
	++this.rendererUpdateCount;
	this.itemRenderer.updateEquippedItem();
	this.addRainParticles();
	this.bossColorModifierPrev = this.bossColorModifier;

	if (BossStatus.hasColorModifier) {
		this.bossColorModifier += 0.05F;

		if (this.bossColorModifier > 1.0F) {
			this.bossColorModifier = 1.0F;
		}

		BossStatus.hasColorModifier = false;
	} else if (this.bossColorModifier > 0.0F) {
		this.bossColorModifier -= 0.0125F;
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:54,代码来源:EntityRenderer.java


示例6: updateRenderer

import net.minecraft.client.shader.ShaderLinkHelper; //导入方法依赖的package包/类
/**
 * Updates the entity renderer
 */
public void updateRenderer()
{
    if (OpenGlHelper.shadersSupported && ShaderLinkHelper.getStaticShaderLinkHelper() == null)
    {
        ShaderLinkHelper.setNewStaticShaderLinkHelper();
    }

    this.updateFovModifierHand();
    this.updateTorchFlicker();
    this.fogColor2 = this.fogColor1;
    this.thirdPersonDistancePrev = 4.0F;

    if (this.mc.gameSettings.smoothCamera)
    {
        float f = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F;
        float f1 = f * f * f * 8.0F;
        this.smoothCamFilterX = this.mouseFilterXAxis.smooth(this.smoothCamYaw, 0.05F * f1);
        this.smoothCamFilterY = this.mouseFilterYAxis.smooth(this.smoothCamPitch, 0.05F * f1);
        this.smoothCamPartialTicks = 0.0F;
        this.smoothCamYaw = 0.0F;
        this.smoothCamPitch = 0.0F;
    }
    else
    {
        this.smoothCamFilterX = 0.0F;
        this.smoothCamFilterY = 0.0F;
        this.mouseFilterXAxis.reset();
        this.mouseFilterYAxis.reset();
    }

    if (this.mc.getRenderViewEntity() == null)
    {
        this.mc.setRenderViewEntity(this.mc.player);
    }

    Entity entity = this.mc.getRenderViewEntity();
    double d2 = entity.posX;
    double d0 = entity.posY + (double)entity.getEyeHeight();
    double d1 = entity.posZ;
    float f2 = this.mc.world.getLightBrightness(new BlockPos(d2, d0, d1));
    float f3 = (float)this.mc.gameSettings.renderDistanceChunks / 16.0F;
    f3 = MathHelper.clamp(f3, 0.0F, 1.0F);
    float f4 = f2 * (1.0F - f3) + f3;
    this.fogColor1 += (f4 - this.fogColor1) * 0.1F;
    ++this.rendererUpdateCount;
    this.itemRenderer.updateEquippedItem();
    this.addRainParticles();
    this.bossColorModifierPrev = this.bossColorModifier;

    if (this.mc.ingameGUI.getBossOverlay().shouldDarkenSky())
    {
        this.bossColorModifier += 0.05F;

        if (this.bossColorModifier > 1.0F)
        {
            this.bossColorModifier = 1.0F;
        }
    }
    else if (this.bossColorModifier > 0.0F)
    {
        this.bossColorModifier -= 0.0125F;
    }

    if (this.field_190567_ac > 0)
    {
        --this.field_190567_ac;

        if (this.field_190567_ac == 0)
        {
            this.field_190566_ab = null;
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:77,代码来源:EntityRenderer.java


示例7: updateRenderer

import net.minecraft.client.shader.ShaderLinkHelper; //导入方法依赖的package包/类
/**
 * Updates the entity renderer
 */
public void updateRenderer()
{
    if (OpenGlHelper.shadersSupported && ShaderLinkHelper.getStaticShaderLinkHelper() == null)
    {
        ShaderLinkHelper.setNewStaticShaderLinkHelper();
    }

    this.updateFovModifierHand();
    this.updateTorchFlicker();
    this.fogColor2 = this.fogColor1;
    this.thirdPersonDistancePrev = 4.0F;

    if (this.mc.gameSettings.smoothCamera)
    {
        float f = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F;
        float f1 = f * f * f * 8.0F;
        this.smoothCamFilterX = this.mouseFilterXAxis.smooth(this.smoothCamYaw, 0.05F * f1);
        this.smoothCamFilterY = this.mouseFilterYAxis.smooth(this.smoothCamPitch, 0.05F * f1);
        this.smoothCamPartialTicks = 0.0F;
        this.smoothCamYaw = 0.0F;
        this.smoothCamPitch = 0.0F;
    }
    else
    {
        this.smoothCamFilterX = 0.0F;
        this.smoothCamFilterY = 0.0F;
        this.mouseFilterXAxis.reset();
        this.mouseFilterYAxis.reset();
    }

    if (this.mc.getRenderViewEntity() == null)
    {
        this.mc.setRenderViewEntity(this.mc.thePlayer);
    }

    float f3 = this.mc.theWorld.getLightBrightness(new BlockPos(this.mc.getRenderViewEntity()));
    float f4 = (float)this.mc.gameSettings.renderDistanceChunks / 32.0F;
    float f2 = f3 * (1.0F - f4) + f4;
    this.fogColor1 += (f2 - this.fogColor1) * 0.1F;
    ++this.rendererUpdateCount;
    this.itemRenderer.updateEquippedItem();
    this.addRainParticles();
    this.bossColorModifierPrev = this.bossColorModifier;

    if (this.mc.ingameGUI.getBossOverlay().shouldDarkenSky())
    {
        this.bossColorModifier += 0.05F;

        if (this.bossColorModifier > 1.0F)
        {
            this.bossColorModifier = 1.0F;
        }
    }
    else if (this.bossColorModifier > 0.0F)
    {
        this.bossColorModifier -= 0.0125F;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:62,代码来源:EntityRenderer.java


示例8: updateRenderer

import net.minecraft.client.shader.ShaderLinkHelper; //导入方法依赖的package包/类
/**
 * Updates the entity renderer
 */
public void updateRenderer()
{
    if (OpenGlHelper.shadersSupported && ShaderLinkHelper.getStaticShaderLinkHelper() == null)
    {
        ShaderLinkHelper.setNewStaticShaderLinkHelper();
    }

    this.updateFovModifierHand();
    this.updateTorchFlicker();
    this.fogColor2 = this.fogColor1;
    this.thirdPersonDistanceTemp = this.thirdPersonDistance;
    this.prevDebugCamYaw = this.debugCamYaw;
    this.prevDebugCamPitch = this.debugCamPitch;
    this.prevDebugCamFOV = this.debugCamFOV;
    this.prevCamRoll = this.camRoll;
    float var1;
    float var2;

    if (this.mc.gameSettings.smoothCamera)
    {
        var1 = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F;
        var2 = var1 * var1 * var1 * 8.0F;
        this.smoothCamFilterX = this.mouseFilterXAxis.smooth(this.smoothCamYaw, 0.05F * var2);
        this.smoothCamFilterY = this.mouseFilterYAxis.smooth(this.smoothCamPitch, 0.05F * var2);
        this.smoothCamPartialTicks = 0.0F;
        this.smoothCamYaw = 0.0F;
        this.smoothCamPitch = 0.0F;
    }

    if (this.mc.renderViewEntity == null)
    {
        this.mc.renderViewEntity = this.mc.thePlayer;
    }

    var1 = this.mc.theWorld.getLightBrightness(MathHelper.floor_double(this.mc.renderViewEntity.posX), MathHelper.floor_double(this.mc.renderViewEntity.posY), MathHelper.floor_double(this.mc.renderViewEntity.posZ));
    var2 = (float)(this.mc.gameSettings.renderDistanceChunks / 16);
    float var3 = var1 * (1.0F - var2) + var2;
    this.fogColor1 += (var3 - this.fogColor1) * 0.1F;
    ++this.rendererUpdateCount;
    this.itemRenderer.updateEquippedItem();
    this.addRainParticles();
    this.bossColorModifierPrev = this.bossColorModifier;

    if (BossStatus.hasColorModifier)
    {
        this.bossColorModifier += 0.05F;

        if (this.bossColorModifier > 1.0F)
        {
            this.bossColorModifier = 1.0F;
        }

        BossStatus.hasColorModifier = false;
    }
    else if (this.bossColorModifier > 0.0F)
    {
        this.bossColorModifier -= 0.0125F;
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:63,代码来源:EntityRenderer.java


示例9: updateRenderer

import net.minecraft.client.shader.ShaderLinkHelper; //导入方法依赖的package包/类
public void updateRenderer()
{
    if (OpenGlHelper.shadersSupported && ShaderLinkHelper.getStaticShaderLinkHelper() == null)
    {
        ShaderLinkHelper.setNewStaticShaderLinkHelper();
    }

    this.updateFovModifierHand();
    this.updateTorchFlicker();
    this.fogColor2 = this.fogColor1;
    this.thirdPersonDistanceTemp = this.thirdPersonDistance;
    this.prevDebugCamYaw = this.debugCamYaw;
    this.prevDebugCamPitch = this.debugCamPitch;
    this.prevDebugCamFOV = this.debugCamFOV;
    this.prevCamRoll = this.camRoll;
    float f;
    float f1;

    if (this.mc.gameSettings.smoothCamera)
    {
        f = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F;
        f1 = f * f * f * 8.0F;
        this.smoothCamFilterX = this.mouseFilterXAxis.smooth(this.smoothCamYaw, 0.05F * f1);
        this.smoothCamFilterY = this.mouseFilterYAxis.smooth(this.smoothCamPitch, 0.05F * f1);
        this.smoothCamPartialTicks = 0.0F;
        this.smoothCamYaw = 0.0F;
        this.smoothCamPitch = 0.0F;
    }

    if (this.mc.renderViewEntity == null)
    {
        this.mc.renderViewEntity = this.mc.thePlayer;
    }

    f = this.mc.theWorld.getLightBrightness(MathHelper.floor_double(this.mc.renderViewEntity.posX), MathHelper.floor_double(this.mc.renderViewEntity.posY), MathHelper.floor_double(this.mc.renderViewEntity.posZ));
    f1 = (float)this.mc.gameSettings.renderDistanceChunks / 16.0F;
    float f2 = f * (1.0F - f1) + f1;
    this.fogColor1 += (f2 - this.fogColor1) * 0.1F;
    ++this.rendererUpdateCount;
    this.itemRenderer.updateEquippedItem();
    this.addRainParticles();
    this.bossColorModifierPrev = this.bossColorModifier;

    if (BossStatus.hasColorModifier)
    {
        this.bossColorModifier += 0.05F;

        if (this.bossColorModifier > 1.0F)
        {
            this.bossColorModifier = 1.0F;
        }

        BossStatus.hasColorModifier = false;
    }
    else if (this.bossColorModifier > 0.0F)
    {
        this.bossColorModifier -= 0.0125F;
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:60,代码来源:EntityRenderer.java



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