Skip to content

Commit

Permalink
Merge pull request #137 from raysan5/develop
Browse files Browse the repository at this point in the history
Integrate Develop branch
  • Loading branch information
raysan5 authored Jul 19, 2016
2 parents 13e18c2 + c482f37 commit ab0d19f
Show file tree
Hide file tree
Showing 33 changed files with 148 additions and 192 deletions.
Binary file modified release/html5/libraylib.bc
Binary file not shown.
Binary file modified release/win32/mingw32/libraylib.a
Binary file not shown.
2 changes: 1 addition & 1 deletion shaders/glsl100/bloom.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ varying vec4 fragColor;

// Input uniform values
uniform sampler2D texture0;
uniform vec4 fragTintColor;
uniform vec4 colDiffuse;

// NOTE: Add here your custom variables

Expand Down
7 changes: 4 additions & 3 deletions shaders/glsl100/blur.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ varying vec4 fragColor;

// Input uniform values
uniform sampler2D texture0;
uniform vec4 fragTintColor;
uniform vec4 colDiffuse;

// NOTE: Add here your custom variables

const float renderWidth = 1280;
const float renderHeight = 720;
// NOTE: Render size values must be passed from code
const float renderWidth = 800;
const float renderHeight = 450;

float offset[3] = float[]( 0.0, 1.3846153846, 3.2307692308 );
float weight[3] = float[]( 0.2270270270, 0.3162162162, 0.0702702703 );
Expand Down
2 changes: 1 addition & 1 deletion shaders/glsl100/cross_hatching.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ varying vec4 fragColor;

// Input uniform values
uniform sampler2D texture0;
uniform vec4 fragTintColor;
uniform vec4 colDiffuse;

// NOTE: Add here your custom variables

Expand Down
7 changes: 4 additions & 3 deletions shaders/glsl100/cross_stitching.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ varying vec4 fragColor;

// Input uniform values
uniform sampler2D texture0;
uniform vec4 fragTintColor;
uniform vec4 colDiffuse;

// NOTE: Add here your custom variables

const float renderWidth = 1280;
const float renderHeight = 720;
// NOTE: Render size values must be passed from code
const float renderWidth = 800;
const float renderHeight = 450;

float stitchingSize = 6.0f;

Expand Down
2 changes: 1 addition & 1 deletion shaders/glsl100/dream_vision.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ varying vec4 fragColor;

// Input uniform values
uniform sampler2D texture0;
uniform vec4 fragTintColor;
uniform vec4 colDiffuse;

// NOTE: Add here your custom variables

Expand Down
2 changes: 1 addition & 1 deletion shaders/glsl100/fisheye.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ varying vec4 fragColor;

// Input uniform values
uniform sampler2D texture0;
uniform vec4 fragTintColor;
uniform vec4 colDiffuse;

// NOTE: Add here your custom variables

Expand Down
7 changes: 4 additions & 3 deletions shaders/glsl100/pixel.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ varying vec4 fragColor;

// Input uniform values
uniform sampler2D texture0;
uniform vec4 fragTintColor;
uniform vec4 colDiffuse;

// NOTE: Add here your custom variables

const float renderWidth = 1280;
const float renderHeight = 720;
// NOTE: Render size values must be passed from code
const float renderWidth = 800;
const float renderHeight = 450;

uniform float pixelWidth = 5.0f;
uniform float pixelHeight = 5.0f;
Expand Down
2 changes: 1 addition & 1 deletion shaders/glsl100/posterization.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ varying vec4 fragColor;

// Input uniform values
uniform sampler2D texture0;
uniform vec4 fragTintColor;
uniform vec4 colDiffuse;

// NOTE: Add here your custom variables

Expand Down
2 changes: 1 addition & 1 deletion shaders/glsl100/predator.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ varying vec4 fragColor;

// Input uniform values
uniform sampler2D texture0;
uniform vec4 fragTintColor;
uniform vec4 colDiffuse;

// NOTE: Add here your custom variables

Expand Down
2 changes: 1 addition & 1 deletion shaders/glsl100/scanlines.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ varying vec4 fragColor;

// Input uniform values
uniform sampler2D texture0;
uniform vec4 fragTintColor;
uniform vec4 colDiffuse;

// NOTE: Add here your custom variables

Expand Down
13 changes: 4 additions & 9 deletions shaders/glsl100/standard.fs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ struct Light {
};

const int maxLights = 8;
uniform int lightsCount;
uniform Light lights[maxLights];

vec3 CalcPointLight(Light l, vec3 n, vec3 v, float s)
Expand Down Expand Up @@ -134,19 +133,15 @@ void main()
float spec = 1.0;
if (useSpecular == 1) spec *= normalize(texture2D(texture2, fragTexCoord).r);

for (int i = 0; i < lightsCount; i++)
for (int i = 0; i < maxLights; i++)
{
// Check if light is enabled
if (lights[i].enabled == 1)
{
// Calculate lighting based on light type
switch (lights[i].type)
{
case 0: lighting += CalcPointLight(lights[i], n, v, spec); break;
case 1: lighting += CalcDirectionalLight(lights[i], n, v, spec); break;
case 2: lighting += CalcSpotLight(lights[i], n, v, spec); break;
default: break;
}
if(lights[i].type == 0) lighting += CalcPointLight(lights[i], n, v, spec);
else if(lights[i].type == 1) lighting += CalcDirectionalLight(lights[i], n, v, spec);
else if(lights[i].type == 2) lighting += CalcSpotLight(lights[i], n, v, spec);
}
}

Expand Down
7 changes: 4 additions & 3 deletions shaders/glsl100/swirl.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ varying vec4 fragColor;

// Input uniform values
uniform sampler2D texture0;
uniform vec4 fragTintColor;
uniform vec4 colDiffuse;

// NOTE: Add here your custom variables

const float renderWidth = 800.0; // HARDCODED for example!
const float renderHeight = 480.0; // Use uniforms instead...
// NOTE: Render size values must be passed from code
const float renderWidth = 800;
const float renderHeight = 450;

float radius = 250.0;
float angle = 0.8;
Expand Down
2 changes: 1 addition & 1 deletion shaders/glsl330/bloom.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ in vec4 fragColor;

// Input uniform values
uniform sampler2D texture0;
uniform vec4 fragTintColor;
uniform vec4 colDiffuse;

// Output fragment color
out vec4 finalColor;
Expand Down
7 changes: 4 additions & 3 deletions shaders/glsl330/blur.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ in vec4 fragColor;

// Input uniform values
uniform sampler2D texture0;
uniform vec4 fragTintColor;
uniform vec4 colDiffuse;

// Output fragment color
out vec4 finalColor;

// NOTE: Add here your custom variables

const float renderWidth = 1280.0;
const float renderHeight = 720.0;
// NOTE: Render size values must be passed from code
const float renderWidth = 800;
const float renderHeight = 450;

float offset[3] = float[](0.0, 1.3846153846, 3.2307692308);
float weight[3] = float[](0.2270270270, 0.3162162162, 0.0702702703);
Expand Down
2 changes: 1 addition & 1 deletion shaders/glsl330/cross_hatching.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ in vec4 fragColor;

// Input uniform values
uniform sampler2D texture0;
uniform vec4 fragTintColor;
uniform vec4 colDiffuse;

// Output fragment color
out vec4 finalColor;
Expand Down
7 changes: 4 additions & 3 deletions shaders/glsl330/cross_stitching.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ in vec4 fragColor;

// Input uniform values
uniform sampler2D texture0;
uniform vec4 fragTintColor;
uniform vec4 colDiffuse;

// Output fragment color
out vec4 finalColor;

// NOTE: Add here your custom variables

const float renderWidth = 1280.0;
const float renderHeight = 720.0;
// NOTE: Render size values must be passed from code
const float renderWidth = 800.0;
const float renderHeight = 450.0;

float stitchingSize = 6.0;

Expand Down
2 changes: 1 addition & 1 deletion shaders/glsl330/depth.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ in vec4 fragColor;

// Input uniform values
uniform sampler2D texture0; // Depth texture
uniform vec4 fragTintColor;
uniform vec4 colDiffuse;

// Output fragment color
out vec4 finalColor;
Expand Down
2 changes: 1 addition & 1 deletion shaders/glsl330/dream_vision.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ in vec2 fragTexCoord;
out vec4 fragColor;

uniform sampler2D texture0;
uniform vec4 fragTintColor;
uniform vec4 colDiffuse;

// NOTE: Add here your custom variables

Expand Down
2 changes: 1 addition & 1 deletion shaders/glsl330/fisheye.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ in vec2 fragTexCoord;
out vec4 fragColor;

uniform sampler2D texture0;
uniform vec4 fragTintColor;
uniform vec4 colDiffuse;

// NOTE: Add here your custom variables

Expand Down
85 changes: 0 additions & 85 deletions shaders/glsl330/phong.fs

This file was deleted.

29 changes: 0 additions & 29 deletions shaders/glsl330/phong.vs

This file was deleted.

7 changes: 4 additions & 3 deletions shaders/glsl330/pixel.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ in vec4 fragColor;

// Input uniform values
uniform sampler2D texture0;
uniform vec4 fragTintColor;
uniform vec4 colDiffuse;

// Output fragment color
out vec4 finalColor;

// NOTE: Add here your custom variables

const float renderWidth = 1280.0;
const float renderHeight = 720.0;
// NOTE: Render size values must be passed from code
const float renderWidth = 800;
const float renderHeight = 450;

uniform float pixelWidth = 5.0;
uniform float pixelHeight = 5.0;
Expand Down
2 changes: 1 addition & 1 deletion shaders/glsl330/posterization.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ in vec4 fragColor;

// Input uniform values
uniform sampler2D texture0;
uniform vec4 fragTintColor;
uniform vec4 colDiffuse;

// Output fragment color
out vec4 finalColor;
Expand Down
Loading

0 comments on commit ab0d19f

Please sign in to comment.