NirViaje / nirviaje.github.io

https://nirviaje.github.io/
17 stars 4 forks source link

Serena's course to ShaderToy #56

Open NirViaje opened 5 years ago

NirViaje commented 5 years ago

所有shadertoy上的程序都有void mainImage( out vec4 fragColor, in vec2 fragCoord )这一行

其中out vec4 fragColor是输出的每个像素点的颜色,in vec2 fragCoord是输入的每个像素点的坐标,就是绘图的坐标位置

image 这是其他能使用的输入常量的列表,包括绘图区域大小、鼠标位置、播放时间等等

2D例子

烟花

image

  1. 画布上每个点是孤立的随时间变化的颜色,互相间没有关系
    • 时间编码在第13行 d = floor(e = i*9.1+iTime);
    • 坐标编码在第7行定义的变量vec2 uv vec2 uv = fragCoord.xy/iResolution.y;
  2. 烟花数量由第12行迭代数量决定 for(float i=1.0; i<9.9; i++) {
  3. floor余数烟花光点运动?
  4. 烟花光点数量由16行循环迭代决定 for(float d=0.; d<15.;d++)
#define N(h) fract(sin(vec4(6,9,1,0)*h))

void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
  vec4 o = vec4(0.0,0.0,1.0,0.0); //背景颜色
  vec2 uv = fragCoord.xy/iResolution.y; //坐标

  float e, d, i=0.2;
  vec4 p;

  for(float i=1.0; i<9.9; i++) {    //烟花数量
    d = floor(e = i*9.1+iTime); //时间
    p = N(d)+.13;
    e -= d;
    for(float d=0.; d<15.;d++)  //烟花光点数量
      o += p*(2.9-e)/1e3/length(uv-(p-e*(N(d*i)-.5)).xy);  
  }

  fragColor = vec4(o.rgb, 1);
}

ShaderToy

image

Black body spectral density

Serena820 commented 5 years ago

好哒

NirViaje commented 5 years ago

other friendly js experimental place

NirViaje commented 5 years ago

Blues - Jazz.zip

midi.zip

NirViaje commented 5 years ago

image

Lecture notes

Week 1

Week 2

Week 3

Week 4

. ..

Week 11

Supplementary materials

NirViaje commented 5 years ago

I will record things I learned here

Mirrors of several sites

Overlay Nav with shortcuts added

Demo

Reference

HTML cheat sheet

three.js

Three.js粒子特效,shader渲染初探 | 六、 shader渲染粒子特效

IoT

MQTT

Captive Network

captive 英 [ˈkæptɪv] 美 [ˈkæptɪv]
adj. 被监禁的;被关起来的;被困住的;人身自由受限制的;受控制的;无权选择的 n. 囚徒;俘虏;战俘

所以,手机只要在连上wifi后,就去向互联网发起一次请求(不同的手机有不同的请求地址,比如苹果手机请求的是www.apple.com,而原版的安卓手机请求的是client3.google.com,但是这些请求的网址,不同的手机厂商自己可以通过修改Android的内核进行修改的,不是绝对的,有的手机甚至直接阉割了这个原版安卓的功能,有的则对这个功能进行了限制使用)。如果返回的网页是被重定向过的,也就是HTTP头的状态是30X的,手机就会认为这个wifi需要强制认证,因此会弹出浏览器,重新发起一次请求。这就是手机连上wifi后会自动弹窗的原理。

Wi-Fi Protected Setup, WPS

image

image

BSB-build-process-0a580a45005b.mp4.zip BROAD Future_-JZV3zvN1l7k.mp4.zip

gmfct.zip https://rechneronline.de/pi/hexagon.php

NirViaje commented 5 years ago

My Toolsets

Software

Hardware

Misc