polyadvent

A game engine from scratch in C
git clone git://jb55.com/polyadvent
Log | Files | Refs | README

commit 4b1cce3d38e145ca6e13e7b16b8e4b308f13ebf6
parent 9a39e4589301ac551c3d59d000d4c3aa6de2f2fd
Author: William Casarin <jb55@jb55.com>
Date:   Mon, 29 Oct 2018 13:22:53 -0700

uniform includes

Diffstat:
Metc/shaders/terrain.glsl | 10++--------
Aetc/shaders/uniforms.glsl | 9+++++++++
Metc/shaders/vertex-color.glsl | 9+--------
3 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/etc/shaders/terrain.glsl b/etc/shaders/terrain.glsl @@ -5,17 +5,11 @@ precision mediump float; in vec3 position; in vec3 normal; -uniform mat4 world; -uniform mat4 mvp; -uniform mat4 depth_mvp; -uniform mat4 model_view; -uniform mat4 normal_matrix; -uniform vec3 camera_position; -uniform vec3 light_dir; -uniform vec3 light_intensity; +#include uniforms.glsl flat out float v_light; flat out vec3 v_color; + out vec3 v_ray; out vec4 shadow_coord; diff --git a/etc/shaders/uniforms.glsl b/etc/shaders/uniforms.glsl @@ -0,0 +1,9 @@ + +uniform mat4 world; +uniform mat4 mvp; +uniform mat4 depth_mvp; +uniform mat4 model_view; +uniform mat4 normal_matrix; +uniform vec3 camera_position; +uniform vec3 light_dir; +uniform vec3 light_intensity; diff --git a/etc/shaders/vertex-color.glsl b/etc/shaders/vertex-color.glsl @@ -7,14 +7,7 @@ in vec3 position; in vec3 normal; in vec3 color; -uniform mat4 world; -uniform mat4 mvp; -uniform mat4 depth_mvp; -uniform mat4 model_view; -uniform mat4 normal_matrix; -uniform vec3 camera_position; -uniform vec3 light_dir; -uniform vec3 light_intensity; +#include uniforms.glsl flat out float v_light; flat out vec3 v_color;