本文整理汇总了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);
}
}
}
示例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);
}
}
示例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);
}
}
示例4: getUniform
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public int getUniform(String label){
// Returns the uniform location.
return OpenGlHelper.glGetUniformLocation(combined, label);
}
示例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);
}
}
}