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


Java ShaderProvider类代码示例

本文整理汇总了Java中com.badlogic.gdx.graphics.g3d.utils.ShaderProvider的典型用法代码示例。如果您正苦于以下问题:Java ShaderProvider类的具体用法?Java ShaderProvider怎么用?Java ShaderProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ShaderProvider类属于com.badlogic.gdx.graphics.g3d.utils包,在下文中一共展示了ShaderProvider类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: create

import com.badlogic.gdx.graphics.g3d.utils.ShaderProvider; //导入依赖的package包/类
@Override
public void create() {
	assets = new AssetManager();
	String model = "Bambo_House.g3db";
	assets.load(model, Model.class);
	assets.finishLoading();
	modelInstance = new ModelInstance(assets.get(model, Model.class), new Matrix4().setToScaling(0.6f, 0.6f, 0.6f));

	DefaultShader.Config config = new Config();
	config.defaultCullFace = GL20.GL_NONE;
	ShaderProvider shaderProvider = new DefaultShaderProvider(config);
	modelBatch = new ModelBatch(shaderProvider);

	ModelBuilder builder = new ModelBuilder();
	float groundSize = 1000f;
	ground = new ModelInstance(builder.createRect(-groundSize, 0, groundSize, groundSize, 0, groundSize, groundSize, 0, -groundSize, -groundSize, 0, -groundSize, 0,
			1, 0, new Material(), Usage.Position | Usage.Normal), new Matrix4().setToTranslation(0, -0.01f, 0));
	environment = new Environment();
	environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.4f, 0.4f, 0.4f, 1f));
	environment.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -1f, -0.8f, -0.2f));

	VirtualReality.renderer.listeners.add(this);
	// VirtualReality.head.setCyclops(true);
}
 
开发者ID:nooone,项目名称:gdx-vr,代码行数:25,代码来源:SimpleRoom.java

示例2: ModelBatch

import com.badlogic.gdx.graphics.g3d.utils.ShaderProvider; //导入依赖的package包/类
/** Construct a ModelBatch, using this constructor makes you responsible for calling context.begin() and context.end() yourself.
 * @param context The {@link RenderContext} to use.
 * @param shaderProvider The {@link ShaderProvider} to use, will be disposed when this ModelBatch is disposed.
 * @param sorter The {@link RenderableSorter} to use. */
public ModelBatch (final RenderContext context, final ShaderProvider shaderProvider, final RenderableSorter sorter) {
	this.sorter = (sorter == null) ? new DefaultRenderableSorter() : sorter;
	this.ownContext = (context == null);
	this.context = (context == null) ? new RenderContext(new DefaultTextureBinder(DefaultTextureBinder.WEIGHTED, 1)) : context;
	this.shaderProvider = (shaderProvider == null) ? new DefaultShaderProvider() : shaderProvider;
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:11,代码来源:ModelBatch.java

示例3: getShaderProvider

import com.badlogic.gdx.graphics.g3d.utils.ShaderProvider; //导入依赖的package包/类
/** @return the {@link ShaderProvider} used by this ModelBatch. */
public ShaderProvider getShaderProvider () {
	return shaderProvider;
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:5,代码来源:ModelBatch.java


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