omid3098 / openflowmap Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Use "Angle" and "Strength" to control the flow direction and its strength just like RealisticFlow
Use "Blend" in place of the original m_flowStrength to blend between original ray direction and the global flow influence
-> reduced gc by caching arrays and temporary texture
-> reduced operations of calling vector normalized from ray constructors and assignments to ray direction
-> reduced vector operations
to make the current code be presented
as custom package in unity:
in BlurEffect.cs, BlurRays(), the pseudocode being
for x
for y
averageDirection = average of neighborhoods of rayCount size around rays(x,y)
write into rays(x,y)
because it writes into rays(x,y) immediately, subsequence rays which are within the neighborhoods e.g. (x, y+1) will get the modified result instead of the original direction values.
During opening unity project, it might cause errors and crashes due to calling OnValidate() on config (and processors) but there may be no valid scene to make the raycasts. Because OpenFlowmapBehaviour is inside a scene, it makes more sense for the behaviour to initilize the baking instead of the Config.
Solution:
Move the rayprojector and baking code into OpenFlowmapBehaviour. then config OnValidate will try to find the behaviour in scene that uses the config and call its initialize.
the processor's OnValidate will call config.OnValidate (which in turn will find behvaiour in scene)
If you'll excuse my impertinance - I'd like to strongly recommend always publishing the entire Unity project. In my experience (and I download a very large number of repos) - it hugely increases the likelihood of things just working and makes it quicker and simpler to try out people's work.
Using this template: https://github.com/adrenak/upm-template you get the best of both worlds as a UPM branch is automatically updated for every commit.
It would be great to have the flow follows the direction in uv space. for example, a river mesh may be curved and would usually be extended along one of the uv direction.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.