blog fixes before posting

This commit is contained in:
ktyl 2024-01-01 15:59:05 +00:00
parent 683db46f39
commit 30dd1e7e01
3 changed files with 9 additions and 5 deletions

View File

@ -1,6 +1,6 @@
# A Tidy Room is a Happy Room # A Tidy Room is a Happy Room
[room-grass.jpg](./room-grass.jpg) ![room-grass.jpg](./room-grass.jpg)
In mid-December I attended a hackathan on Meta's campus in central London. In mid-December I attended a hackathan on Meta's campus in central London.
It was something of a novel experience, as I'm much more used to the kind ofevents put on by university student bodies. It was something of a novel experience, as I'm much more used to the kind ofevents put on by university student bodies.
@ -70,7 +70,7 @@ Our mechanic involved cutting the grass.
Since the grass was not GameObjects, there was no object to destroy or transform to compare, so we needed another way to relate a position within the room to something the grass could understand. Since the grass was not GameObjects, there was no object to destroy or transform to compare, so we needed another way to relate a position within the room to something the grass could understand.
Moritz had created a an array of points covering the floor, taking into account raised parts of the scene mesh to determine where grass ought to be. Moritz had created a an array of points covering the floor, taking into account raised parts of the scene mesh to determine where grass ought to be.
[free-spots.png](./free-spots.png) ![free-spots.png](./free-spots.png)
We opted to use a render texture to communicate this information to the grass' vertex shader. We opted to use a render texture to communicate this information to the grass' vertex shader.
This approach meant we could write in information about the pre-existing furniture at startup, and use the same technique to update the grass at runtime. This approach meant we could write in information about the pre-existing furniture at startup, and use the same technique to update the grass at runtime.
@ -79,8 +79,9 @@ Green points should have grass on startup, and so they write a white pixel into
Everywhere else is initially black, which means the grass should be cut at that location. Everywhere else is initially black, which means the grass should be cut at that location.
When points are collected, they write black into the texture, cutting the grass at that location. When points are collected, they write black into the texture, cutting the grass at that location.
[room-rt.png](./room-rt.png) ![room-rt.png](./room-rt.png)
[grass-rt.png](./grass-rt.png)
![grass-rt.png](./grass-rt.png)
The last step was to sample the render texture and use it to remove grass at a particular location. The last step was to sample the render texture and use it to remove grass at a particular location.
We can sample using the UV which was scaled to the room during position generation. We can sample using the UV which was scaled to the room during position generation.
@ -100,4 +101,4 @@ That's it for the main moving parts we implemented on top of Acerola's grass for
The final experience is available on [AppLab](https://www.oculus.com/experiences/7147643091959624/release-channels/386799520513932/?token=Ns1Z92Rx). The final experience is available on [AppLab](https://www.oculus.com/experiences/7147643091959624/release-channels/386799520513932/?token=Ns1Z92Rx).
Thanks for reading, and please [get in touch](mailto:me@ktyl.dev) if you have any questions! Thanks for reading, and please [get in touch](mailto:me@ktyl.dev) if you have any questions!
[team.jpg](./team.jpg) ![team.jpg](./team.jpg)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB

BIN
blogs/2024/1/1/grass-rt.png (Stored with Git LFS) Normal file

Binary file not shown.