本文整理汇总了Java中com.base.engine.rendering.Material类的典型用法代码示例。如果您正苦于以下问题:Java Material类的具体用法?Java Material怎么用?Java Material使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Material类属于com.base.engine.rendering包,在下文中一共展示了Material类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateUniforms
import com.base.engine.rendering.Material; //导入依赖的package包/类
public void updateUniforms(Matrix4f worldMatrix, Matrix4f projectedMatrix, Material material)
{
if(material == null) return;
if(material.getTexture() != null)
material.getTexture().bind();
else
RenderUtil.unbindTextures();
setUniform("transformProjected", projectedMatrix);
setUniform("transform", worldMatrix);
super.setUniform("baseColor", material.getColor());
setUniform("ambientLight", ambientLight);
setUniform("directionalLight", directionalLight);
for(int i = 0; i < pointLights.length; i++)
setUniform("pointLights[" + i + "]", pointLights[i]);
for(int i = 0; i < spotLights.length; i++)
setUniform("spotLights[" + i + "]", spotLights[i]);
setUniformf("specularIntensity", material.getSpecularIntensity());
setUniformf("specularPower", material.getSpecularPower());
setUniform("eyePos", Transform.getCamera().getPos());
}
示例2: AddVertices
import com.base.engine.rendering.Material; //导入依赖的package包/类
public void AddVertices(FloatBuffer vertices, IntBuffer indices)
{
shader = new Shader("forward-ambient2");
material = new Material(new Texture("bricks.jpg"), 1, 8,
new Texture("bricks_normal.jpg"), new Texture("bricks_disp.png"), 0.03f, -0.5f);
resource = new MeshResource(indices.capacity());
glBindBuffer(GL_ARRAY_BUFFER, resource.GetVbo());
glBufferData(GL_ARRAY_BUFFER, vertices, GL_STATIC_DRAW);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, resource.GetIbo());
glBufferData(GL_ELEMENT_ARRAY_BUFFER, indices, GL_STATIC_DRAW);
}
示例3: updateUniforms
import com.base.engine.rendering.Material; //导入依赖的package包/类
public void updateUniforms(Matrix4f worldMatrix, Matrix4f projectedMatrix, Material material)
{
if(material.getTexture() != null)
material.getTexture().bind();
else
RenderUtil.unbindTextures();
setUniform("transform", projectedMatrix);
setUniform("color", material.getColor());
}
示例4: MeshRenderer
import com.base.engine.rendering.Material; //导入依赖的package包/类
public MeshRenderer(Mesh mesh, Material material)
{
this.m_mesh = mesh;
this.m_material = material;
}
示例5: init
import com.base.engine.rendering.Material; //导入依赖的package包/类
public void init(){
worldMat = new Material(new Texture("terrain.png"), new Vector3f(1,1,1), 0, 0);
}
示例6: updateUniforms
import com.base.engine.rendering.Material; //导入依赖的package包/类
public void updateUniforms(Matrix4f worldMatrix, Matrix4f projectedMatrix, Material material)
{
}