#ASCII Shader
1 messages · Page 1 of 1 (latest)
I tried doing it through a script and using the canvas, but it's absurdly inefficient
this is the type of effect I am going for
- Round the UV to the center of its grid position, and sample at that position, so each fragment in the grid square has the same position.
- Remap the UV from the local grid position to the position in the text texture but offset by the (1.) position, then sample the the text.
what is the center of its grid position?
┌───────────────────┐
│...................│
│...................│
│...................│
│.........x.........│
│...................│
│...................│
│...................│
└───────────────────┘
Every . should sample from the X so they all get the same value from the scene. You've got to divide the UV into the grid where the letters will be and area needs to sample its center
so each pixel would be the same color
in that area
would it work for all the.to be filtered out and then only the X color remains. And then go through all of the pixels that have the color and then put an image of a character with its center over the X
Shaders don't work that way
each fragment is unique and doesn't know about the things around it
oh ok i see
which is why each fragment has to look for the value it should represent so each grid shows the same letter
if they didn't all sample the center position then each pixel might show a different letter which would just come out as a garbled mess
so every . pixel can see what the X pixel is
it can only see what the input is, which is presumably the camera's color
ohh wait so all the . look at the input from the X position, so all of them are the same color?
but once all the pixels are the same color in that area, how do you convert it into a letter?
i'm one step closer
HELLO
you create a second UV grid that samples the letters
Remap the UV from the local grid position to the position in the text texture but offset by the rounded position, then sample the the text.
omg for each pixel in the square do i check the corresponding pixel in the image of the character