Sign in to follow this  
Followers 0
Dad72

Multi-camera and WaterMaterial

77 posts in this topic

This is what I now have for refraction. Maybe the shader has to be compiled 2 times and not once. I do not know. But with what you have done, the refraction no longer works.

594501072d644_2017-06-1712_13_59-Waterbug.thumb.jpg.85e765c7502f8d9dea228d615d3403a0.jpg

Share this post


Link to post
Share on other sites

am i understand correctly ? the problem is watermaterial cant take CustomMaterial Result for reflect?

Untitled.png

Share this post


Link to post
Share on other sites

Try to play with the inspector by disabling the reflection on each PG above to see the difference.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Yes this seems random FPS. It seems better sometimes, but after several refreshing, it ended up going bad.

Maybe it will go after this problem Uniforms correct.

Share this post


Link to post
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

Share this post


Link to post
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.

 

Share this post


Link to post
Share on other sites

I'll see tonight, I have to leave to take my daughter to a dance gala.

Please Nasimi, help me to make it work on my PG. Thanks

Share this post


Link to post
Share on other sites

that need change some setting in water material i need time to understand that before

Dad72 likes this

Share this post


Link to post
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

Luaacro likes this

Share this post


Link to post
Share on other sites

@NasimiAsl what do you plan to modify in water material ? The problem comes from shader cache:

- render normal : no clip plane

- render refraction: clip plane is set

So cache is reseted 

Dad72 likes this

Share this post


Link to post
Share on other sites

I will not know how to reproduce this PG, I know nothing about shaderMaterial. :(

 

Share this post


Link to post
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

Luaacro likes this

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

i make rendertarget with camera2 in that  i don't see this error i am know looking the source of mirror plan to find answer

i dont know how much time i need but i look that in this week maybe that complete soon

Share this post


Link to post
Share on other sites
2 hours ago, NasimiAsl said:

i make rendertarget with camera2 in that  i don't see this error

Do you have an example please ? Even with a single camera I have this error.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.