Giter Site home page Giter Site logo

atg-simulator / realtimedynamicwindshieldwaterfx Goto Github PK

View Code? Open in Web Editor NEW
56.0 12.0 17.0 19.87 MB

Worlds 1st Dynamic Windshield Wiper Water FX for Unity Game Engine

Home Page: http://AroundTheGround.TK

License: MIT License

C# 18.57% ShaderLab 81.43%
shaders fx unity unity3d unity-3d unity-asset unity-scripts unity-tutorial 3dmodels rain

realtimedynamicwindshieldwaterfx's Introduction

Real-time Windshield Waterdrops FX

with a bonus 3D car model!

This is an FX for Unity for recreating the water drops when hitting a car windshield and its wipers. it is inspired by the amazing FX of the Drive Club video game. Originally it was made in 2015 by me, with the help of Eric Chadwick and Obscura from PolyCount for a Unity3D passion project.

After some time I decided to share it as I stopped developing it. Make this FX the world's best one for the community if possible!! Each script has comments and guidelines. Hopefully, editing and modifying this Unity asset is easy for you.


Installation

Please watch a video for more convenience here: https://youtu.be/04xqSVFx7uo.

  1. Open a new empty project in Unity
  2. Copy and paste the contents of the "Assets" folder here to there
  3. Go to the physics settings in Unity and uncheck every check mark for the "water" and the "TransparentFX" layers. Then, only check the "TransparentFX/Water" and "Water/Water" checkmarks.
  4. Open the scene called "Main" in "Assets\WindshieldFXAsset\SceneData"
  5. Download ShaderForge for Unity 2018.3 or later here: https://github.com/roguesleipnir/ShaderForge
  6. Open the scene called "Main" in "WindshieldFXAsset\SceneData"
  7. Have fun playing with the asset!

How it works

When you play the scene, you notice water drops react to the acceleration and a set of imaginary windshield wipers. That is because a "hidden" set of objects are calculating the behavior of the waterdrops. In the below text, you'll learn how this "hidden" system is working.

The way it works

  1. There is a system that is stationary and simulates the water drops, the water drops are white spheres being controlled by CPU.
  2. A Camera records the behavior of the white spheres and projects them on the car's windshield, the shader of the windshield calculates the shape of the waterdrops via GPU.
  3. Unlike the car, the system is stationary, but it reads the G-Force of the car to simulate the water drops realistically.

NOTICE!

  • The very first thing you have to do after downloading the project, is to open it and then go to the Physics Layers option. There, you can see which layers collide with the other layers. Thus, setting up physics layer collisions is vital for the performance of your Unity project.
  • The second thing you have to do, is to observe which game objects have the layers.
  • And the next thing is to check how the hierarchy, cameras parameters, and rigid-body collision types are set. These are self-explanatory, hopefully, you can understand how everything is set up now.

Support this asset!

I commented on every important line of the scripts, hopefully, everything is easy to understand. Have fun improving this asset for the community.

A Demo

Here is a small demo of this asset in Around The Ground simulator project.

Click here to watch the video

Checkout this blog post for more details and information.

Regards, Dan.

realtimedynamicwindshieldwaterfx's People

Contributors

atg-simulator avatar d4n005h avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

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.