5

I followed Jonathan Kron's tutorial on creating an LED-display shader. It basically multiplies together your desired image with a grid of little RGB images. It looks great when zoomed in, but when the camera / 3D view zooms out, the "lit" LEDs disappear (shader graph at the bottom):

Zoomed in (red image) Zoomed out (red image)

I would expect that they'd still be viewable, just a little more dim. To my surprise, this problem does not happen when I change the color of the "LED image" from red to green:

Zoomed in (green image) Zoomed out (green image)

Why does this happen? How can I keep the red color showing when the camera / 3D view zooms out?

Shader graph

Benjamin
  • 53
  • 3
  • 1
    Maybe due to aliasing, the LED texture at this scale becomes completely green? – Markus von Broady Apr 05 '21 at 10:41
  • 1
    Your led-check.png image doesn't have any Texture Coordinates connected so it will default to using UVs while the other images use Generated. I don't see how that could cause the texture to disappear at a distance, but it was the first thing that jumped out at me from your screenshot. – gcs_dev Apr 05 '21 at 11:40
  • 1
    Also, the keyframed Fac of the Color Mix node is a negative value, that could cause some unexpected behaviour. – gcs_dev Apr 05 '21 at 12:04
  • @gcs_dev thanks those are both good guesses; unfortunately, fixing those does not solve the problem – Benjamin Apr 05 '21 at 12:16
  • @MarkusvonBroady I tried playing with the values in Preferences > Viewport but unfortunately, none of them seemed to affect it. – Benjamin Apr 05 '21 at 12:20
  • Are the 'x' or 'check' images themselves striped? My guess is somewhere, downsampling is going out of phase, sampling only the black stripes. I've made a procedural version of the screen-filter, so not using your led-rgb.png, and it's working OK. – Robin Betts Apr 05 '21 at 18:34

1 Answers1

4

This may have to do with the downsampling of the filter ('led-rgb') image.. I've made a node-group which makes the 'Trinitron' filter procedurally, instead:

enter image description here

  • By wrapping the scaled UV space into 0-1 cycles, it produces square UV tiles, 0-1 per tile. ('in-pixel UV')
  • By subtracting that from the smooth UV, we get a per-tile UV coordinate, at scale. That's scaled back down to an overall 0-1 to look up the color in the image(s). ('pixellated UV')
  • The 'in-pixel UV' X generates R,G and B strips per square tile, using the color ramp
  • The 'in-pixel UV' X,mod(1/3), and Y, are compared to 0 to generate black bars between the RGB strips, and the tiles. ('X Bar' and 'Y Bar')
  • The X Bars, Y Bars, and RGB strips are multiplied with the image to be depicted.

With this effect:

enter image description here

Used with solid green and red logos, it seems to stand up to Level-of-Detail resampling OK:

enter image description here

batFINGER
  • 84,216
  • 10
  • 108
  • 233
Robin Betts
  • 76,260
  • 8
  • 77
  • 190
  • 1
    This works great, although "wrap" seems to be missing from my math node, so "modulo" worked alright. – Benjamin Apr 06 '21 at 04:03
  • Hi, @Benjamin! Thanks! Sorry, yes. That's Vector Math > Wrap, there in 2.8x. The only reason to use it is that it's an all-positive sawtooth, where Modulo dips into the negative with numerators below 0. 'Generated' never does, so that's OK, here. – Robin Betts Apr 06 '21 at 06:03
  • @batFINGER Thanks! I guess we .. er.. I, have to be of a certain age.... – Robin Betts Apr 06 '21 at 08:29
  • Throw this I in too. Huge blast from past seeing Trinitron together with the RGB colorramp. Wonder what the age is that the q Who or what is Trinitron? rings no bells. – batFINGER Apr 06 '21 at 08:41