Jump to content

Multi-camera and WaterMaterial


Dad72
 Share

Recommended Posts

I've just seen on my local project, the reverse happens. I have refraction of sand, but I have no texture sand on the terrain to load. 

strange. But I think the problem is about loading textures. Your patch has trigger another reaction.

Link to comment
Share on other sites

i think one camera get correct ( reflect & refract camera is correct ) 

i don't know about watermaterial workflow maybe need some read that before i answer

*** it is not related for this post i see you use 8 more texture in your project i think you most use Atlas Texture and make one texture

Link to comment
Share on other sites

I use a camera on the PG above.

I need to use the 8 textures available for my terrain editor. Hence my choice of using ShaderBuilder because it allowed more textures

What do I have to do ? I do not understand. You mean that I should not use 8 textures that are yet available with ShaderBuilder.

 

Link to comment
Share on other sites

@NasimiAsl  On this PG I manage to reverse and receive the refraction of the ground, but no texture outside the water.

In fact, it is, or one has the refraction of the soil and no texture on the ground, or one has the textures on the ground but no refraction.

I do not know if that can help. I try to understand myself also why this product.

Textures ground but not refraction : http://www.babylonjs-playground.com/#1SLLOJ#304

Refraction but not textures ground : http://www.babylonjs-playground.com/#1SLLOJ#306

Maybe @Luaacro can help you understand what is wrong. It is he who created the material of water. It can explain to you how it works or look at what does not go right to give you a track. Thanks Luaacro

Link to comment
Share on other sites

@NasimiAsl I recreate a PG with the idea of Luaacro. (using a mirror texture will reproduce the same problem)

And indeed, the ground is not reflected in the panel. No mirror

no waterMaterial. use MirrorTexture of StandardMaterial: http://www.babylonjs-playground.com/#EKFLA#267

Before your fix reflection and refraction worked, but there is going to be the problem of FPS. Now the shader is compiling once, but maybe it should be recompile when using refraction, reflection. Considering that it is only compiled once, the problem may be from there.

Exemple with MirrorTexture : http://www.babylonjs-playground.com/#EKFLA#13

Link to comment
Share on other sites

@NasimiAsl Have you been able to have a look at the extra PG you have requesting?

I think your previous PR is not enough if the shader needs to be recompiled a second time. With the use of refraction, mirror, the shader needs to be recompiled a second time I suppose. You'd have to be able to do it manually or something. With function rebuild. I do not know.

Thanks

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