Giter Site home page Giter Site logo

Comments (5)

huwb avatar huwb commented on May 18, 2024 1

Thanks dude. I did a bunch of cleanup and refactoring today and cleared up some of the mess that accumulated over time in the foam code.

I've added a toggle to turn 3D foam shading on and off. I've added 3 parameters for controlling where foam appears - the ones beginning with "Wave Foam ..". I also added two parameters to tweak the 3D foam shading - a directional light scale and a normal strength.

This is all pushed to master now. I'll close this as i believe the feature dev part is done (now for the bugs!). Let me know how you get on with it.

from crest.

huwb avatar huwb commented on May 18, 2024

@Midda-C had some success today. I just pushed some stuff to a new branch foam_lighting, commit ed6c4f1

I'm generating normals for the foam that give it 3d structure, with a round edge profile. It looks like this:

image

What do you think?

While working on this i realised the bubble/underwater foam also doesnt work well at all, mainly because its just slapped onto the surface. I've now pushed it under the surface by adding refraction offsets, dialling down the motion a bit so it moves independently of the surface white foam, and added a bit of parallax based on view direction to push the texture downwards under the surface. I really like the result, its a million times better IMO. Needs to be seen under motion. Let me know what you think if you can get this branch, otherwise I'll get it promoted to master if you're happy with the above image (as an initial pass at least) and after i've done a bit of cleanup.

from crest.

huwb avatar huwb commented on May 18, 2024

One more shot for good measure:

image

from crest.

Midda-C avatar Midda-C commented on May 18, 2024

Yeah, just tried it out, it's looking good! Probably only thing I think is left really are some properties to adjust the thresholds for where foam appears (e.g. height/steepness, opacity, etc), but that's not really related to the lighting/shading.

Nice work!

from crest.

huwb avatar huwb commented on May 18, 2024

@Midda-C

The latest merge into master (of the sim branch) brings with it a big rebuild of the foam shading. I removed some ugly stuff and tried to make the foam look much less severe. The foam now adopts the normal of the water before doing NdL (so it should sit better in the frame/scene), and there's a configurable specular component as well as i realised foam should be shiny :). The below is a first pass of tweaking it. It's not perfect but it already feels much more harmonious and natural to me.

image

As always, apologies for any retweaking this requires, but i hope the results are worth it. Feedback welcome!

from crest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.