本文整理汇总了Java中com.badlogic.gdx.graphics.g3d.utils.BaseShaderProvider类的典型用法代码示例。如果您正苦于以下问题:Java BaseShaderProvider类的具体用法?Java BaseShaderProvider怎么用?Java BaseShaderProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BaseShaderProvider类属于com.badlogic.gdx.graphics.g3d.utils包,在下文中一共展示了BaseShaderProvider类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import com.badlogic.gdx.graphics.g3d.utils.BaseShaderProvider; //导入依赖的package包/类
@Override
public void create () {
modelBatch = new ModelBatch(new BaseShaderProvider() {
@Override
protected Shader createShader (Renderable renderable) {
return new TestShader();
}
});
cam = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
cam.position.set(10f, 10f, 10f);
cam.lookAt(0, 0, 0);
cam.near = 0.1f;
cam.far = 300f;
cam.update();
camController = new CameraInputController(cam);
Gdx.input.setInputProcessor(camController);
Material material = new Material(new TestAttribute(1f));
ModelBuilder builder = new ModelBuilder();
model = builder.createCone(5, 5, 5, 20, material, Usage.Position);
instance = new ModelInstance(model);
testAttribute = (TestAttribute)instance.materials.get(0).get(TestAttribute.ID);
}