[HN Gopher] Write shaders for the (sim) Vegas sphere
       ___________________________________________________________________
        
       Write shaders for the (sim) Vegas sphere
        
       Author : jjwiseman
       Score  : 162 points
       Date   : 2023-11-29 19:14 UTC (3 hours ago)
        
 (HTM) web link (whenistheweekend.com)
 (TXT) w3m dump (whenistheweekend.com)
        
       | OutThisLife wrote:
       | Love this idea.
        
       | jxf wrote:
       | That's super cool! What shader language is this using?
        
         | thethimble wrote:
         | GLSL - OpenGL Shader Language
         | 
         | Definitely check out ShaderToy to see many other examples:
         | https://www.shadertoy.com/
        
           | jxf wrote:
           | Ah, thanks! I was trying to copy-paste some examples and they
           | didn't quite work -- it looks like ShaderToy exposes a
           | mainImage(out vec4, in vec2) function with a different
           | signature than the simulation-Sphere site wants. For example
           | there's no main() method in here [0] and I wasn't sure how to
           | translate that to the sphere's expected inputs.
           | 
           | [0] https://www.shadertoy.com/view/Ms2SDc
        
             | HellsMaddy wrote:
             | Yeah, you will need to adapt the code a bit: https://gist.g
             | ithub.com/b0o/ac939eb1608f949765ac842fe28f53b9
        
             | hex4def6 wrote:
             | Yeah, looks like there's a couple of differences. If you
             | look at the top left there are a few examples that are
             | shadertoy examples. Example 5 (Smiley face) shows some
             | differences:
             | 
             | * the void main() declaration difference
             | 
             | * the inclusion of iTime vs time
             | 
             | * gl_FragColor vs fragcolor
             | 
             | Also, the demo adds:
             | 
             | uniform float time;
             | 
             | varying vec2 vUv;
             | 
             | varying vec3 vNormal;
             | 
             | I think those are the biggest differences.
        
       | xnx wrote:
       | Very well done. Bright lights even bleed (not sure the right
       | word) beyond the border of the sphere to simulate atmosphere (or
       | lens?) effects.
        
         | speps wrote:
         | An effect called "bloom" in computer graphics
        
           | caseyohara wrote:
           | And called "halation" in photography & imaging
           | 
           | > the spreading of light beyond its proper boundaries to form
           | a fog around the edges of a bright image in a photograph or
           | on a television screen
        
       | modeless wrote:
       | Cool idea to overlay the real time rendering on a video of the
       | actual sphere. Someone ought to capture a gaussian splatting
       | scene of the sphere, that would be even better.
        
       | vjerancrnjak wrote:
       | Here's a static penrose tiling.
       | 
       | https://gist.github.com/vjeranc/265db912d4004c7c0b0f16ae5fda...
       | 
       | Interestingly, sphere is not infinite so having this aperiodic
       | tiling is pointless (still looks nice).
       | 
       | Although, I never found out if there's a similar set of tiles (or
       | a monotile) that can tile an infinite cone.
        
         | dllthomas wrote:
         | > cone
         | 
         | For physical tiles, clearly not as the curvature would be
         | wrong. I'm sure there remain interesting questions, but it's
         | not sufficiently obvious to me what projection makes sense that
         | I'm able to get further into the problem.
        
           | vjerancrnjak wrote:
           | Penrose tiling has nice properties in physical world
           | https://mitxela.com/projects/penrose_pixels (one example, but
           | there are others, placing CMOS sensors in that pattern in
           | cameras allows for a higher resolution, read that somewhere).
           | 
           | Doing aperiodic tilings on a cone properly might allow for
           | different traction properties that are not present in
           | ubiquitous periodic patterns used on tires, barbells etc.
        
         | DesiLurker wrote:
         | might be interesting to slowly 'move' the sphere through
         | infinite aperiodic tiled plane.
        
           | vjerancrnjak wrote:
           | vec2 st = (vUv.xy * h + time/100. + 1.);
           | 
           | This will move it with time.
           | 
           | The tiling is not infinite, it's inside a big triangle, so
           | with enough time you will travel outside of it, but I guess
           | with proper bounds you can move around or make the triangle
           | bigger.                  vec2 st = (vUv.xy *
           | h/(1.+0.5*cos(time)) + time/100. + 1.);
           | 
           | Periodic zooming. Looks like the sphere gets dressed in a
           | cape.
        
       | fassssst wrote:
       | Fun with ChatGPT, just tell it to write some GLSL shader code for
       | a shader that would look cool on the Las Vegas Sphere.
        
       | ArekDymalski wrote:
       | Very nice project! It would be great to have a separate url for
       | each code (embed it in the url perhaps?) for easy sharing.
        
       | troupo wrote:
       | Offtopic but what fascinates me is how big of an actual
       | _engineering_ project The Sphere is.
       | 
       | From the structure itself to the syncing thousands of LED panels
       | inside the sphere and outside the sphere, while keeping them
       | cooled _in Vegas_ while keeping it cool enough and ventilated
       | inside for a seating capacity of 18 000 people.
       | 
       | There are run-of-the mill office buildings which fail to provide
       | adequate ventilation.
        
         | bluescrn wrote:
         | All that effort, all those resources, just to get more eyeballs
         | on ads.
        
           | scrumper wrote:
           | I'd normally be there on the barricades with you but this is
           | maybe a _little_ too cynical? The Sphere is a big performance
           | art space, a piece of cutting edge technology that's a canvas
           | and a playground for boundary-pushing visionaries, not a
           | giant billboard.
           | 
           | Oh. I forgot about the exterior surface. And five seconds on
           | image search tells me you were right. Well goddamn. Hard to
           | imagine it'd cover its costs without that stuff, but yuck all
           | the same.
        
           | ipython wrote:
           | The show currently running inside the sphere is focused on
           | the negative human impact to the environment. So clearly the
           | owners of the sphere are interested in spreading that
           | narrative, if that helps you feel better about their use of
           | resources.
           | 
           | Obviously selling ads is a mechanism to pay the bills and
           | defray the massive building costs. It's not like the rest of
           | Vegas is some sort of moral high ground, so ads on its
           | exterior kind of fits right in.
        
       | nicbarth wrote:
       | Fun project! Here's a simple smiley.frag:
       | https://gist.github.com/nickbarth/4ec5147bd1288fd2bcfc4c5b46...
        
       | atum47 wrote:
       | That's very nice. Look at the solution a person pushed for my
       | isocity project [1]. It enables to share a URL with your city
       | creation
       | 
       | Maybe you can implement something like that
       | 
       | 1 -
       | https://github.com/victorqribeiro/isocity/commit/c6588171e37...
        
       ___________________________________________________________________
       (page generated 2023-11-29 23:00 UTC)