Jump to content

Cannot get shadows to work in my shader


Recommended Posts

While trying to make my own shader I seem to get stuck in getting shadows to work for a directional light. I copy/pasted what I believe are all the relevant parts from the babylon standard shaders into my own vertex and fragment shaders, and while it compiles and light/textures work just fine, shadows do not appear.

Could anyone point me to the issue? gl throws a warning about lack of textures, but I don't believe that affects the outcome as my complete shader with textures has the same issue.

http://www.babylonjs-playground.com/#1JFVDG#0; Uncomment line 124 to apply the shader to the ground mesh.

Thanks again as usual :)

PS. the playground seems to hang quite a lot trying to run this code, out of the playground it works fine.

Link to comment
Share on other sites


can you simply this example further? Maybe then you find the problem by yourself.

I cant even rerun the playground, it keeps crashing my browser.

And after few trials and errors, i think the problem is somewhere in your prototype functions. Shadowmap as a remainder for myself is very simple, you got a light, you bake a texture and project it on an object. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...