Jump to content

I am been working on a Java Game Engine, creating a test scene however, I am noticed that the cubes I have loaded using a mesh renderer appear black no matter what colour I change the source of light.

 

Here is the code I have to render the cube obj file:

package com.base.engine.components;import com.base.engine.rendering.Material;import com.base.engine.rendering.Mesh;import com.base.engine.rendering.RenderingEngine;import com.base.engine.rendering.Shader;public class MeshRenderer extends GameComponent{	private Mesh     m_mesh;	private Material m_material;	public MeshRenderer(Mesh mesh, Material material)	{		this.m_mesh = mesh;		this.m_material = material;	}	@[member=OverRide]	public void Render(Shader shader, RenderingEngine renderingEngine)	{		shader.Bind();		shader.UpdateUniforms(GetTransform(), m_material, renderingEngine);		m_mesh.Draw();	}}

If you need more file samples I'll post them.

"Instinct or Rationality; Which will you choose? Enchanted by a superiority complex"

"what you do in spite of internet speed is inspiring. :3" From Cae - 2015

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×