简体   繁体   中英

Is it possible to render one single pixel in a WebGL animation?

I'm looking at the animations at https://www.shadertoy.com

Is is possible to display only one specific pixel from such animations?

So theoretically the full animation is running and being calculated, but only one single pixel from an arbitrary X,Y display point is being displayed ie pseudocode:

  • startAnimation(filenameOfAnimation, X, Y)

So it plays the animation but displays only the pixel as point X,Y

Why, you ask? Imagine a very large digital sign composed of a number of raspberry pi devices for example, each Raspberry Pi has its own tiny OLED display that represents one pixel of the whole animation. I would like to be able to play that animation across all of the Raspberry Pi devices.

Actually what is interesting is that the code on shadertoy is running as a fragment shader. This means that the code that you see is actually being used to calculate each pixel. When you see the fragCoord variable being used, that is referring to the individual pixel being displayed. If you wanted to calculate an individual pixel value, you already have the code there. Just plug in the pixel you want and there you go! You could give each device the code and assign it a pixel to simulate. Then plug that pixel into the code and there you go!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM