Open infinityplusb opened 2 years ago
As an example, I created
Material rayleighSkyMaterial;
then further down the scene in afterLoad()
I added
auto waterShader = New!WaterShader(game.deferredRenderer.gbuffer, assetManager, assetManager);
waterShader.waterColor = Color4f(0.05f, 0.2f, 0.0f, 1.0f);
rayleighSkyMaterial = addMaterial();
rayleighSkyMaterial.shader = waterShader;
then I add the Material like
Entity NPC_1 = addEntity();
NPC_1.drawable = aOBJNPC.mesh;
NPC_1.position = Vector3f(10, 2 ,20 + i * 2);
NPC_1.material = rayleighSkyMaterial;
But it still comes out with a blank material.
I was wondering if you had an example of how to use Shaders? I've tried adding an existing one to a new Material, but it doesn't seem to be showing.