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 <stdlib.h> | |
#include <stdio.h> | |
#include <time.h> | |
#include <pvm3.h> | |
#include <unistd.h> | |
#include <math.h> | |
# define SIZE 1000 | |
# define NPROCS 5 |
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
static inline uint64_t cf_getms() | |
{ | |
struct timespec ts; | |
clock_gettime(CLOCK_MONOTONIC, &ts); | |
return ((uint64_t)ts.tv_nsec / 1000000) + ((uint64_t)ts.tv_sec * 1000); | |
} | |
static inline uint64_t cf_getus() | |
{ | |
struct timespec ts; |
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
// BitwiseOperations.glsl | |
const int BIT_COUNT = 8; | |
int modi(int x, int y) { | |
return x - y * (x / y); | |
} | |
int or(int a, int b) { | |
int result = 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
#ifndef PHONG_LIGHTING_INC | |
#define PHONG_LIGHTING_INC 1 | |
#define USE_OPTIMIZATION 1 | |
#include "BRDF.h" | |
float GetAngleAttenuation(vec3 _l, vec3 _lightDir, float _angleScale, float _angleOffset) | |
{ | |
float cosa = -dot(_l, _lightDir); |
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 "shared/glslversion.h" | |
#include "glslcommon.inc" | |
#include "uniforms.inc" | |
in | |
#include "VertexData.h" | |
#include "LightData.h" | |
layout(location = 0) out vec4 my_FragColor0; |
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
using System; | |
namespace Rextester | |
{ | |
public class ArrayHelper | |
{ | |
int[] _result; | |
public int[] result | |
{ |
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
//Convert to 24bit | |
const float3 depthFactor = float3(65536.0f/16777215.0f, 256.0f/16777215.0f, 1.0f/16777215.0f ); | |
float GetDepth( float4 raw_depth ) | |
{ | |
return dot( round( raw_depth.xyz * 255.0f.xxx ), depthFactor.xyz); | |
} | |
float2 texcoord = in.vpos/g_Resolution; | |
pos.xy = in.vpo; | |
pos.z = GetDepth( tex2D(g_Depthmap,texcoord).rgba ); |
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
[GLSL_VERTEX_SHADER] | |
#include "shared/glslversion.h" | |
#include "glslcommon.inc" | |
#include "uniforms.inc" | |
layout(location = 0) in vec4 vposition; | |
layout(location = 5) in vec2 vtexcoord; | |
out vec2 ftexcoord; |
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 vFrustumCornersWS[8] = | |
{ | |
float3(-1.0, 1.0, 0.0), // near top left | |
float3( 1.0, 1.0, 0.0), // near top right | |
float3(-1.0, -1.0, 0.0), // near bottom left | |
float3( 1.0, -1.0, 0.0), // near bottom right | |
float3(-1.0, 1.0, 1.0), // far top left | |
float3( 1.0, 1.0, 1.0), // far top right | |
float3(-1.0, -1.0, 1.0), // far bottom left | |
float3( 1.0, -1.0, 1.0) // far bottom right |
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
ViewDir = normalize(vCameraPos.xyz - vWorldPos.xyz); |