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


Java OpenGlHelper.glGetUniformLocation方法代码示例

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


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

示例1: setupUniforms

import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
/**
 * goes through the parsed uniforms and samplers and connects them to their GL counterparts.
 */
private void setupUniforms()
{
    int i = 0;

    for (int j = 0; i < this.samplerNames.size(); ++j)
    {
        String s = (String)this.samplerNames.get(i);
        int k = OpenGlHelper.glGetUniformLocation(this.program, s);

        if (k == -1)
        {
            logger.warn("Shader " + this.programFilename + "could not find sampler named " + s + " in the specified shader program.");
            this.shaderSamplers.remove(s);
            this.samplerNames.remove(j);
            --j;
        }
        else
        {
            this.shaderSamplerLocations.add(Integer.valueOf(k));
        }

        ++i;
    }

    for (ShaderUniform shaderuniform : this.shaderUniforms)
    {
        String s1 = shaderuniform.getShaderName();
        int l = OpenGlHelper.glGetUniformLocation(this.program, s1);

        if (l == -1)
        {
            logger.warn("Could not find uniform named " + s1 + " in the specified" + " shader program.");
        }
        else
        {
            this.shaderUniformLocations.add(Integer.valueOf(l));
            shaderuniform.setUniformLocation(l);
            this.mappedShaderUniforms.put(s1, shaderuniform);
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:45,代码来源:ShaderManager.java

示例2: setF

import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public void setF(String name, float val) {
	if(!ShaderManager.isReloading()) {
		int in = OpenGlHelper.glGetUniformLocation(program, name);
		ARBShaderObjects.glUniform1fARB(in, val);
	}
}
 
开发者ID:ArekkuusuJerii,项目名称:Solar,代码行数:7,代码来源:ShaderResource.java

示例3: setI

import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public void setI(String name, int val) {
	if(!ShaderManager.isReloading()) {
		int in = OpenGlHelper.glGetUniformLocation(program, name);
		ARBShaderObjects.glUniform1iARB(in, val);
	}
}
 
开发者ID:ArekkuusuJerii,项目名称:Solar,代码行数:7,代码来源:ShaderResource.java

示例4: getUniform

import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public int getUniform(String label){
    // Returns the uniform location.
    return OpenGlHelper.glGetUniformLocation(combined, label);
}
 
开发者ID:SerenityEnterprises,项目名称:SerenityCE,代码行数:5,代码来源:Shader.java

示例5: setupUniforms

import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
/**
 * goes through the parsed uniforms and samplers and connects them to their GL counterparts.
 */
private void setupUniforms()
{
    int i = 0;

    for (int j = 0; i < this.samplerNames.size(); ++j)
    {
        String s = (String)this.samplerNames.get(i);
        int k = OpenGlHelper.glGetUniformLocation(this.program, s);

        if (k == -1)
        {
            LOGGER.warn("Shader {}could not find sampler named {} in the specified shader program.", new Object[] {this.programFilename, s});
            this.shaderSamplers.remove(s);
            this.samplerNames.remove(j);
            --j;
        }
        else
        {
            this.shaderSamplerLocations.add(Integer.valueOf(k));
        }

        ++i;
    }

    for (ShaderUniform shaderuniform : this.shaderUniforms)
    {
        String s1 = shaderuniform.getShaderName();
        int l = OpenGlHelper.glGetUniformLocation(this.program, s1);

        if (l == -1)
        {
            LOGGER.warn("Could not find uniform named {} in the specified shader program.", new Object[] {s1});
        }
        else
        {
            this.shaderUniformLocations.add(Integer.valueOf(l));
            shaderuniform.setUniformLocation(l);
            this.mappedShaderUniforms.put(s1, shaderuniform);
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:45,代码来源:ShaderManager.java


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