Comments (5)
I don't remember the exact reasons I had at the time but I believe I found the viewport to be a bit more flexible initally. It allowed me e.g. to overlap and compose multiple textures inside the viewport. I could also access the viewport texture from any sprite and did not need to worry about positioning since the viewport would always cover the entire screen.
However, I did not really end up making use of these advantages since the final (drawable) texture covered the entire screen anyways. So I guess you're right, it's not really needed here. I tried not putting too much of an emphasis in the tutorial though, since I'm aware that there are advantages and disatvantages to using a viewport.
I will close this later if you don't have any more questions.
EDIT: Wrong account, oops :D
from 2dgrassshaderdemo.
for viewport, i only see disadvantages. you say
'I found the viewport to be a bit more flexible initally' and
'access the viewport texture from any sprite'
this can be done by sprite directly , considering any scale, pivot and position
and you say
'the final (drawable) texture covered the entire screen'
this is the problem!. when you have camera2D and the screen is changeable, and you want the grass to be static, the viewport will be big problem. that is , it will change with the Camera2D.
from 2dgrassshaderdemo.
As I said, I just found the viewport to work better for me when I initially started doing this. I still see some advantages to using a viewport (such as only having to worry about a single texture at all times). Your approach then is of course completely valid and may be better suited for your needs (especially for Camera2D since I did not really take this into account when making this demo).
from 2dgrassshaderdemo.
ok understand 👍
from 2dgrassshaderdemo.
I'll close this then, feel free to open a new issue if you have more remarks.
from 2dgrassshaderdemo.
Related Issues (4)
- Bug or float equals problem? HOT 1
- better performance HOT 1
- This is awesome HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from 2dgrassshaderdemo.