This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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); |
NewerOlder