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


Java Material类代码示例

本文整理汇总了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());
}
 
开发者ID:jaxfrank,项目名称:Voxel-Based-Game-Engine-Java,代码行数:27,代码来源:PhongShader.java

示例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);
}
 
开发者ID:RagnarrIvarssen,项目名称:Assimp-Tutorial-LWJGL-3,代码行数:15,代码来源:AnimatedComponent.java

示例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());
}
 
开发者ID:jaxfrank,项目名称:Voxel-Based-Game-Engine-Java,代码行数:11,代码来源:BasicShader.java

示例4: MeshRenderer

import com.base.engine.rendering.Material; //导入依赖的package包/类
public MeshRenderer(Mesh mesh, Material material)
{
	this.m_mesh = mesh;
	this.m_material = material;
}
 
开发者ID:RagnarrIvarssen,项目名称:Assimp-Tutorial-LWJGL-3,代码行数:6,代码来源:MeshRenderer.java

示例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);
}
 
开发者ID:jaxfrank,项目名称:Voxel-Based-Game-Engine-Java,代码行数:4,代码来源:WorldRenderer.java

示例6: updateUniforms

import com.base.engine.rendering.Material; //导入依赖的package包/类
public void updateUniforms(Matrix4f worldMatrix, Matrix4f projectedMatrix, Material material)
{
	
}
 
开发者ID:jaxfrank,项目名称:Voxel-Based-Game-Engine-Java,代码行数:5,代码来源:Shader.java


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