diff options
| author | raysan5 <raysan5@gmail.com> | 2016-05-20 12:28:07 +0200 |
|---|---|---|
| committer | raysan5 <raysan5@gmail.com> | 2016-05-20 12:28:07 +0200 |
| commit | dcf5f45f687f2a534286aecd5e6471a0440b0c21 (patch) | |
| tree | 42a5028ebab3277a8d46bdcf3fea2990e1aa590d /src/raylib.h | |
| parent | af890cf21021e4a306bf3f6e4397496b95c1c93a (diff) | |
| download | raylib-dcf5f45f687f2a534286aecd5e6471a0440b0c21.tar.gz raylib-dcf5f45f687f2a534286aecd5e6471a0440b0c21.zip | |
Add lighting system -IN PROGRESS-
Improved materials
Diffstat (limited to 'src/raylib.h')
| -rw-r--r-- | src/raylib.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/raylib.h b/src/raylib.h index fc1914bb..d98a0797 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -422,13 +422,38 @@ typedef struct Material { float normalDepth; // Normal map depth } Material; -// 3d Model type +// Model type typedef struct Model { Mesh mesh; // Vertex data buffers (RAM and VRAM) Matrix transform; // Local transform matrix Material material; // Shader and textures data } Model; +// Light type +// TODO: Review contained data to support different light types and features +typedef struct LightData { + int id; + int type; // LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT + bool enabled; + + Vector3 position; + Vector3 direction; // Used on LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction) + float attenuation; // Lost of light intensity with distance (use radius?) + + Color diffuse; // Use Vector3 diffuse (including intensities)? + float intensity; + + Color specular; + //float specFactor; // Specular intensity ? + + //Color ambient; // Required? + + float coneAngle; // SpotLight +} LightData, *Light; + +// Light types +typedef enum { LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT } LightType; + // Ray type (useful for raycast) typedef struct Ray { Vector3 position; @@ -849,6 +874,9 @@ void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // S void SetBlendMode(int mode); // Set blending mode (alpha, additive, multiplied) +Light CreateLight(int type, Vector3 position, Color diffuse); // Create a new light, initialize it and add to pool +void DestroyLight(Light light); // Destroy a light and take it out of the list + //---------------------------------------------------------------------------------- // Physics System Functions (Module: physac) //---------------------------------------------------------------------------------- |
