com.badlogic.gdx.graphics.g3d.Shader Java Examples

The following examples show how to use com.badlogic.gdx.graphics.g3d.Shader. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GameRenderer.java    From GdxDemo3D with Apache License 2.0 6 votes vote down vote up
public GameRenderer(Viewport viewport, Camera camera, GameEngine engine) {
	this.viewport = viewport;
	this.camera = camera;
	this.engine = engine;

	shapeRenderer = new MyShapeRenderer();
	shapeRenderer.setAutoShapeType(true);

	spriteBatch = new SpriteBatch();
	font = new BitmapFont();
	font.setColor(Color.WHITE);
	font.setUseIntegerPositions(false);
	font.getData().setScale(0.01f);
	shadowBatch = new ModelBatch(new DepthShaderProvider());

	ShaderProgram.pedantic = false;
	final String vertUber = Gdx.files.internal("shaders/uber.vert").readString();
	final String fragUber = Gdx.files.internal("shaders/uber.frag").readString();
	modelBatch = new ModelBatch(new DefaultShaderProvider(vertUber, fragUber) {
		@Override
		protected Shader createShader(final Renderable renderable) {
			return new UberShader(renderable, config);
		}
	});
}
 
Example #2
Source File: PBRDepthShaderProvider.java    From gdx-gltf with Apache License 2.0 5 votes vote down vote up
@Override
protected Shader createShader(Renderable renderable) {
	
	// TODO only count used attributes, depth shader only require a few of them.
	PBRCommon.checkVertexAttributes(renderable);
	
	return new PBRDepthShader(renderable, config, DepthShader.createPrefix(renderable, config) + morphTargetsPrefix(renderable));
}
 
Example #3
Source File: ModelComponent.java    From Mundus with Apache License 2.0 4 votes vote down vote up
public ModelComponent(GameObject go, Shader shader) {
    super(go);
    type = Type.MODEL;
    materials = new ObjectMap<String, MaterialAsset>();
    this.shader = shader;
}
 
Example #4
Source File: CubesShaderProvider.java    From Cubes with MIT License 4 votes vote down vote up
@Override
public int compareTo(Shader other) {
  return other == null ? -1 : 0;
}
 
Example #5
Source File: RainRenderer.java    From Cubes with MIT License 4 votes vote down vote up
@Override
public int compareTo(Shader other) {
  return other == null ? -1 : 0;
}
 
Example #6
Source File: PickerShader.java    From Mundus with Apache License 2.0 4 votes vote down vote up
@Override
public int compareTo(Shader other) {
    return 0;
}
 
Example #7
Source File: PickableModelComponent.java    From Mundus with Apache License 2.0 4 votes vote down vote up
public PickableModelComponent(GameObject go, Shader shader) {
    super(go, shader);
}
 
Example #8
Source File: PickableTerrainComponent.java    From Mundus with Apache License 2.0 4 votes vote down vote up
public PickableTerrainComponent(GameObject go, Shader shader) {
    super(go, shader);
}
 
Example #9
Source File: ModelComponent.java    From Mundus with Apache License 2.0 4 votes vote down vote up
public void setShader(Shader shader) {
    this.shader = shader;
}
 
Example #10
Source File: ModelComponent.java    From Mundus with Apache License 2.0 4 votes vote down vote up
public Shader getShader() {
    return shader;
}
 
Example #11
Source File: TerrainComponent.java    From Mundus with Apache License 2.0 4 votes vote down vote up
public void setShader(Shader shader) {
    this.shader = shader;
}
 
Example #12
Source File: TerrainComponent.java    From Mundus with Apache License 2.0 4 votes vote down vote up
public Shader getShader() {
    return shader;
}
 
Example #13
Source File: TerrainComponent.java    From Mundus with Apache License 2.0 4 votes vote down vote up
public TerrainComponent(GameObject go, Shader shader) {
    super(go);
    this.shader = shader;
    type = Component.Type.TERRAIN;
}
 
Example #14
Source File: ModelShader.java    From Mundus with Apache License 2.0 4 votes vote down vote up
@Override
public int compareTo(Shader other) {
    return 0;
}
 
Example #15
Source File: TerrainShader.java    From Mundus with Apache License 2.0 4 votes vote down vote up
@Override
public int compareTo(Shader other) {
    return 0;
}
 
Example #16
Source File: SkyboxShader.java    From Mundus with Apache License 2.0 4 votes vote down vote up
@Override
public int compareTo(Shader other) {
    return 0;
}
 
Example #17
Source File: DemoMotionGdxAdapter.java    From thunderboard-android with Apache License 2.0 4 votes vote down vote up
protected Shader createShader(Renderable renderable) {
    return new EmissiveShader(renderable, this.config);
}