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
// Okay, the Win8 version of d3dcompiler.dll is *substantially* faster to compile | |
// shaders, but switching to the Win8 SDK outright is painful if you need to | |
// support older compilers (the new headers don't work with old VC++ versions) | |
// or use D3DX. | |
// | |
// However, there's a dead simple solution that works just fine. | |
// Just link against June 2010 DX SDK d3dcompiler.lib and use its header files, | |
// then do this: | |
typedef HRESULT (__stdcall d3d_compile_func)(LPCVOID pSrcData, SIZE_T SrcDataSize, LPCSTR pSourceName, const D3D_SHADER_MACRO *pDefines, ID3DInclude *pInclude, LPCSTR pEntrypoint, LPCSTR pTarget, UINT Flags1, UINT Flags2, ID3DBlob **ppCode, ID3DBlob **ppErrorMsgs); |
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
GLuint glx_compile_shader_source( GLenum type, char const * source ) | |
{ | |
if ( !source ) | |
return 0; | |
// explicitly copy the source together so we can dump it as one string | |
size_t source_len = strlen( source ); | |
char * fused_source = new char[shader_header_len + source_len + 1]; | |
strcpy( fused_source, shader_header ); | |
strcpy( fused_source + shader_header_len, source ); |
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
#define SAMPLE_COUNT {{ sampleCount }} | |
#define USE_ACTUAL_NORMALS {{ useActualNormals }} | |
uniform sampler2D sGBuffer; | |
uniform sampler2D sNoise; | |
uniform float uSampleRadius; | |
uniform float uIntensity; | |
uniform vec2 uNoiseScale; | |
uniform vec3 uKernel[SAMPLE_COUNT]; |
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
// number of directions to sample in UV space | |
#define NUM_SAMPLE_DIRECTIONS {{ numSampleDirections }} | |
// number of sample steps when raymarching along a direction | |
#define NUM_SAMPLE_STEPS {{ numSampleSteps }} | |
#define APPLY_ATTENUATION {{ attenuation }} | |
#define USE_ACTUAL_NORMALS {{ useActualNormals }} |
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
// total number of samples at each fragment | |
#define NUM_SAMPLES {{ numSamples }} | |
#define NUM_SPIRAL_TURNS {{ numSpiralTurns }} | |
#define USE_ACTUAL_NORMALS {{ useActualNormals }} | |
#define VARIATION {{ variation }} | |
uniform sampler2D sGBuffer; |
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
from OpenGL.GL import * | |
import Image | |
import numpy | |
imname = 'uv-grey.jpg' | |
# glTexImage2D expects the first element of the image data to be the bottom-left corner of the image. | |
# Subsequent elements go left to right, with subsequent lines going from bottom to top. | |
# | |
# However, the image data was created with PIL Image tostring and numpy's fromstring, which means we |
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
# kudos to https://github.com/drewlesueur | |
# stolen from here: https://github.com/blog/266-fast-forward-your-fork#comment-11535 | |
git checkout -b upstream-master | |
git remote add upstream git://github.com/documentcloud/underscore.git | |
git pull upstream master | |
git checkout master // [my master branch] | |
git merge upstream-master | |
git push origin master |
NewerOlder