0
$\begingroup$

The effect I'm trying to achieve is to have it so that the texture is pixilated/quantized, but the "grid," stays aligned to world coordinates even as the object with it's own UV coordinates moves around.

The closest I've gotten is the following psuedocode, which at least should give kind of an idea of what I'm after (though I can't get the grid to actually stay still like I want).

float DIVISIONS = 16.0;
vec3 coords = UV + world_position;

//quantize
coords = floor(coords * DIV) / DIV;

OUT_COLOR = coords - world_position;

In my own head it's scratching the area right between "this likely isn't possible," and "this feels like it should be solvable with some math," but I just can't seem to get the right equation down.

EDIT: Here is a video demonstration made using some compositing effects of roughly what I'm trying to acheive (though not perfect) https://youtu.be/eFJIG47Wp_E

$\endgroup$
2
  • $\begingroup$ I think you need to discribe it in more detail... Maybe you can provide some images to see how it should be? Also it is helpful to tell for what you need this effect... $\endgroup$
    – Thomas
    Dec 7, 2023 at 17:42
  • 1
    $\begingroup$ Ok, just make a video and provided a link since it's something you kind of have to see in motion to be able to understand. The purpose of this is so that I can render pixilated objects that align with the global pixel grid in the same render pass that I render non-pixilated objects. The standard way would be to do this in two passes and composite them together, but I was curious if I could do this in just one. I'm only concerned with UVs being pixilated, not the object outlines (which I couldn't do in compositing). $\endgroup$ Dec 9, 2023 at 22:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.