captainproton42 / 2dgrassshaderdemo Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Thanks for making and publishing this ❤️
Hello, I found that using viewport had many problems, for example, when i use environment and
canvasmodulate, or using character camera2D. So I decided to realize your method using sprite directly. Now I almost finished it.
I setup the scene as following , without any viewport.
I realized following fuctions:
All in all, without viewport I can realize all your functions, and viewport have many limitions. So Why you use viewport and not sprite directly???
Wonderful project. I always think using shader to do dynamic grass, this give me good ideas. When i follow your instructions, i found one problem:
you use float equals, and i find this is not safe. if use
if dist / 255.0 == texture(tex, uv).r
the result will be wrong
and use
if (abs(dist / 255.0 - texture(tex, uv).r) < 0.0000001), the result will be correct. Maybe for float, use equal is not safe
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.