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
| /* SDF */ | |
| float sdSphere( vec3 p, float s ) | |
| { | |
| return length(p)-s; | |
| } | |
| float sdBox( vec3 p, vec3 b ) | |
| { | |
| vec3 q = abs(p) - b; |
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
| void mainImage( out vec4 fragColor, in vec2 fragCoord ) { | |
| // Normalized pixel coordinates (from 0 to 1) | |
| vec2 uv = (2.0 * fragCoord- iResolution.xy) / iResolution.y; | |
| vec3 ro = vec3(0., 2.0, -5.); | |
| vec3 rd = normalize(vec3(uv.x, uv.y, 1.)); | |
| vec3 col = vec3(0.25, .15, .2); // Sky color |
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
| PVector location; | |
| PVector velocity; | |
| Mover mover; | |
| void setup() | |
| { | |
| size(640, 360); | |
| location = new PVector(100,100); | |
| velocity = new PVector(2.5, 5.); | |
| mover = new Mover(); | |
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
| /* Use this to clear GBuffer like...*/ | |
| float3 GetNormalWorldSpace(float2 uv, float depth) | |
| { | |
| float3 normalWS = 0.0f; | |
| if (depth > 0.0f) | |
| { | |
| NormalData normalData; | |
| const float4 normalBuffer = LOAD_TEXTURE2D_X(_NormalBufferTexture, uv); | |
| DecodeFromNormalBuffer(normalBuffer, uv, normalData); |
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
| float3 normalWS = GetNormalWorldSpace(positionSSRegular, depth); |
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
| float GetDepth(int2 SSRegular) | |
| { | |
| return LOAD_TEXTURE2D_X(_CameraDepthTexture, SSRegular).x; | |
| } |
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 LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 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
| #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) | |
| float4 CustomPostProcess(Varyings input) : SV_Target | |
| { | |
| UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); | |
| uint2 positionSSRegular = input.texcoord* _ScreenSize.xy;... | |
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
| #include <iostream> | |
| #include <cmath> | |
| #include <fstream> | |
| #define M_PI 3.1415926 | |
| using namespace std; | |
| const int sampleRate = 44100; | |
| const int bitDepth = 16; | |
| class SineOscillator { |
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
| #include <conio.h> | |
| void print(const char* s) | |
| { | |
| for (; *s != 0; s++) | |
| { | |
| _putch(*s); | |
| } | |
| } |