Skip to content

Instantly share code, notes, and snippets.

View 0b5vr's full-sized avatar

0b5vr 0b5vr

View GitHub Profile
@0b5vr
0b5vr / -protips.md
Last active February 11, 2021 17:57
help (shader royale protips + training + final outcome)

haha

Basics

  • Use shorter syntax / shorter variable name as possible
    • You still might want to leave comments for visual cue
  • One pass! No additional passes!
    • Most emissive / specular oriented scenes will suffer since there is no bloom available
  • You should ask the organizer about their compo machine
    • You might want to consider the factor in order to achieve constant 60fps?
// (c) FMS_Cat, MIT License
// Can be used at https://fms-cat.com/shader-playground/
precision highp float;
varying vec2 vUv;
uniform float time;
// yoinked from https://github.com/hughsk/glsl-noise (MIT License)
vec4 mod289(vec4 x)
@0b5vr
0b5vr / genbun.glsl
Last active August 7, 2021 14:55
prod05 sierpinski chord by 0x4015完全理解した
// https://www.youtube.com/watch?v=H8UqnTE3mUY より引用
#define A for(int i=0;i<9;++i){int y=p>>((p>>19)+i&3),z=p*((878086607>>(i&7)*4)&15)*(510+1%5)>>14;if((p>>15&1<<(i&15))>0)s.y+=float(((y>>7&z*3|y>>11&z*6)&1023)-512)/3e4;}
vec2 mainSound(float t){int p=int(t*144e3);vec2 s;A;s.yx=s;p-=65536;A;return s*mat2(7,1,5,-3);}
{
"scene" : 0,
"scenes" : [ {
"nodes" : [ 0 ]
} ],
"nodes" : [ {
"mesh" : 0
} ],
@0b5vr
0b5vr / mods
Created January 19, 2020 14:41
'incoming',
'space',
'hallway',
'distant',
'boost',
'brake',
'wave',
'dizzy',
'twirl',
'roll',
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>=^.^=</title>
<style>
body{
margin: 0;
}
@0b5vr
0b5vr / material-renderorder.html
Created March 26, 2019 09:29
Three.js : Test case for #16063
<!DOCTYPE html>
<body></body>
<style>
body {
background-color: #000;
margin: 0px;
overflow: hidden;
}
@0b5vr
0b5vr / twiv.bat
Last active December 6, 2023 04:40
Batch: ffmpeg video trimmer optimized for Twitter
@echo off
setlocal
rem (c) 0b5vr, MIT License https://opensource.org/licenses/MIT
set FILE=""
set START=0
set TIME=139
set WIDTH=-1
set OUTPUT=twiv.mp4
@0b5vr
0b5vr / vidya2gif.bat
Last active December 6, 2023 04:16
Batch: any video to gif
@echo off
setlocal
rem (c) 0b5vr, MIT License https://opensource.org/licenses/MIT
set FILE=""
set START=0
set TIME=65536
set WIDTH=-1
set COLORS=32
@0b5vr
0b5vr / WebGLVRMRenderLists.ts
Created December 25, 2018 07:16
WebGLVRMRenderLists.ts : Hacked WebGLRenderLists.js to use VRM/Unity's renderQueue
/**
* It's WebGLRenderLists.js in original Three.js source code, but hacked.
* Original source code is distributed under MIT license. (This code is also under MIT license)
* https://github.com/mrdoob/three.js/blob/26631d0ad87238c3988fb469c28869c2df99a4b2/src/renderers/webgl/WebGLRenderLists.js
*
* Procedure:
* 1, `convertGLTFMaterials()` (see `./convert.ts`) --- we append `userData.vrmMaterialProperties` field to materials
* 2, `WebGLRenderList.push()` --- we read `material.userData.vrmMaterialProperties.renderQueue` and put into `vrmRenderQueue` field of `RenderItem`
* 3, `painterSortStable()` --- Sort our render order using `RenderItem.renderQueue`, it's now rendered correctly!
*