Jump to content

GroundFromHeightMap and createInstance() ???


meteoritool
 Share

Recommended Posts

Thank you !

This perfectly solves the problem !
If I understand right, the height map image must be already loaded in order to create good instances,w hat I don't understand: why do they still display in my wrong version? It seems they disappear "too soon", as if they were considered off-screen in the wrong way... this must be webGL engine getting coordinates for the instanced textures wrong, maybe ???

So now it leads to another question ^_^ : The "CreateGroundFromHeightMap" function asks for an "url" parameter to load the height map image.
My textures were already loaded by my assets manager, so how do I tell the function to get an already existing texture instead of an url ??? it is a bit "newbie question" I guess :/

Thank you !!!

Link to comment
Share on other sites

Not sure to understand what you are trying to achieve here but I can say one thing: same is FAR too large for shadows. You will lose all precision with such a scene.

 

Regarding your previous question: why do they still display in my wrong version? because they were created when the ground was just a small box and thus they received a wrong bounding box

 

Link to comment
Share on other sites

Hello,

So, if I compare our two examples, I understand that shadow emitting meshes should be clones rather instances ! Am I right ? They seem to behave different:
//move the camera up and down to see what happens with shadows:
http://playground.babylonjs.com/#25K1LA#4 // Shadows emitters are instances of a box
http://playground.babylonjs.com/#25K1LA#6 // Shadows emitters are clones of a box

On 2/15/2016 at 9:42 PM, Deltakosh said:

Not sure to understand what you are trying to achieve here but I can say one thing: scene is FAR too large for shadows. You will lose all precision with such a scene.

I'm trying to build a very long corridor where i=the corridor length
Is there an improvement in computing/details if I use a short light range ? Is this the good way to go ?
Should I consider creating multiple ShadowGenerators or is it only: one scene = one shadowmap ?
I will also try to add fog later but that's another story >_<

Thanks for your answers you rule ;-)

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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