[HN Gopher] Faking Shaders III: Tixyland
       ___________________________________________________________________
        
       Faking Shaders III: Tixyland
        
       Author : surprisetalk
       Score  : 27 points
       Date   : 2024-11-14 23:39 UTC (3 days ago)
        
 (HTM) web link (garten.salat.dev)
 (TXT) w3m dump (garten.salat.dev)
        
       | CppPro wrote:
       | How do you fake a shader? What does that mean?
        
         | __m wrote:
         | You simulate them running in the browser instead of a GPU
        
           | ImHereToVote wrote:
           | You mean the CPU right? Browsers can send commands to the GPU
           | too.
        
       | calibas wrote:
       | It's an HTML canvas, but you can give it input similar to a
       | shading language?
        
       | Lerc wrote:
       | Suggestion
       | 
       | change the line                   `${lib};const
       | {sin,cos,tan,random,PI,sqrt,hypot,atan,atan2} = Math; ${code};
       | return main;`
       | 
       | to                   `${lib};const
       | {${Object.getOwnPropertyNames(Math)}} = Math; ${code}; return
       | main;
       | 
       | To bring in all of Math into context without having to list them
       | all individually.
        
       ___________________________________________________________________
       (page generated 2024-11-18 23:02 UTC)