This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vec4 packDepth(const in float depth) { | |
const vec4 bit_shift = vec4( 256.0*256.0*256.0, 256.0*256.0, 256.0, 1.0); | |
const vec4 bit_mask = vec4( 0.0, 1.0/256.0, 1.0/256.0, 1.0/256.0); | |
vec4 res = fract(depth * bit_shift); | |
res -= res.xxyz * bit_mask; | |
return res; | |
} | |
float unpackDepth(const in vec4 rgba_depth) { | |
const vec4 bit_shift = vec4(1.0/(256.0*256.0*256.0), 1.0/(256.0*256.0), 1.0/256.0, 1.0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
/// *** COLOR TRANSFORMATION *** | |
//http://beesbuzz.biz/code/hsv_color_transforms.php | |
vec3 rgb2yiq(vec3 color){return color * mat3(0.299,0.587,0.114,0.596,-0.274,-0.321,0.211,-0.523,0.311);} | |
vec3 yiq2rgb(vec3 color){return color * mat3(1.,0.956,0.621,1,-0.272,-0.647,1.,-1.107,1.705);} | |
// Direkt HSV transzformacio | |
vec3 hsvTransform(vec3 color, vec3 hsv){float _h = hsv.x, _s = hsv.y, _v = hsv.y; float VSU = _v*_s*cos(_h*PI/180.), VSW = _v*_s*sin(_h*PI/180.), rr = (.299*_v+.701*VSU+.168*VSW)*color.x + (.587*_v-.587*VSU+.330*VSW)*color.y + (.114*_v-.114*VSU-.497*VSW)*color.z, gg = (.299*_v-.299*VSU-.328*VSW)*color.x + (.587*_v+.413*VSU+.035*VSW)*color.y + (.114*_v-.114*VSU+.292*VSW)*color.z, bb = (.299*_v-.300*VSU+1.25*VSW)*color.x + (.587*_v-.588*VSU-1.05*VSW)*color.y + (.114*_v+.886*VSU-.203*VSW)*color.z; return vec3(rr,gg,bb); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace { | |
//works! | |
///@return 0 if everything succeeds 1 otherwise (or throw an exception) | |
int initLoader(){ | |
this->loader.s_loader= new FWrender::Shader(); | |
this->loader.s_loader->createFromMemory( /* create(&vss, &fss) */ | |
"#version 330 core\n" | |
"layout(location = 0) in vec3 "SHADER_ATTRIB_VERTEX";" | |
"void main(){" | |
"gl_Position = vec4("SHADER_ATTRIB_VERTEX",1.);" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://iquilezles.org/www/articles/distfunctions/distfunctions.htm | |
// -- Distant functions | |
float sdPlane( vec3 p ) {return p.y+0.2;} | |
float sdSphere( vec3 p, float s ) {return length(p)-s;} | |
float sdCylinder( vec3 p, vec3 c ){ return length(p.xz-c.xy)-c.z; } | |
float udRoundBox( vec3 p, vec3 b, float r ){return length(max(abs(p)-b,0.0))-r;} | |
float udRoundBoxInf( vec3 p, vec2 b, float r ){return length(max(vec3(abs(p.xz)-b,0.0),0.0))-r;} | |
float maxcomp( vec3 p ) {return max(p.x,max(p.y,p.z));} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;; Description goez here | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
; exit by typing 'qqq' | |
:*:qqq:: | |
{ | |
exitapp 0 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IHR stands for interpolated HiRes. | |
This basically interpolates two HiRes images, one in even frames, and the | |
other in odd frames resulting in more colors, and up to 4 colors per 8x8 | |
block. The selection of colors are limited though: they can be a mix of the | |
colors selected for the two source planes. It also limits mixing that if two | |
colors which supposed to make the displayed color are too far from each | |
other, the image will noticably flicker, and will be tiring for the eye to | |
look at it (Mixing black and white would result in 25Hz or 30Hz pratical | |
update rate what is simply miserable). There are several combinations though |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import xml.etree.ElementTree as ET | |
class XMLBuilder(object): | |
def __init__(self, _outfile): | |
self._outfile = _outfile | |
self._outXML = None | |
def __enter__(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* forward differencing method for bezier curve */ | |
void BKE_curve_forward_diff_bezier(float q0, float q1, float q2, float q3, float *p, int it, int stride) | |
{ | |
float rt0, rt1, rt2, rt3, f; | |
int a; | |
f = (float)it; | |
rt0 = q0; | |
rt1 = 3.0f * (q1 - q0) / f; | |
f *= f; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Launch Chrome against localhost, with sourcemaps", | |
"type": "chrome", | |
"request": "launch", | |
"url": "http://localhost:3000", | |
"sourceMaps": true, | |
"webRoot": "${workspaceRoot}/src/ts/main.ts" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set encoding=utf-8 | |
set fileencoding=utf-8 | |
filetype plugin indent on | |
syntax on | |
set smartindent | |
set expandtab | |
set ignorecase | |
set smartcase |
OlderNewer