[SOLVED] Very Simple Shader not showing

We’re looking to create some custom shaders for our game. I have a very simple flag shader like so: https://nme.babylonjs.com/#QPRJU9#24

For the life of me, I can’t get it to show in our project. I don’t get any errors, I can’t spot anything I missed (believe me I’ve tried) and even tried looking at the mesh from different angles. My fragmant shader is literally just a color assignment, so I’d be really surprised if that’s causing the issue.

I’ve you’re taught in the ways of shaders and may fix this for me I owe you one!

I captured this with Spector JS … and it seems both your vertex and fragment shader has uniforms that you are not settings. Particularly u_ViewProjection is all just zeros.

I’d suggest to look at the shader the cube is using, and use the same uniform names for those typical parameters so that engine can set them for you - specifically this one is matrix_viewProjection.

1 Like

@CaseyDeCoder - can confirm renaming the matrices as @mvaligursky suggested works - like this: https://playcanvas.com/editor/code/776412?tabs=44457762 - running here: https://launch.playcanvas.com/1113914?debug=true


Thank you both so much! It works great now (especially using a sphere model). I’ll also get me a copy of Spector JS because that sounds too handy!

1 Like