mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-11 22:08:15 +00:00
Add lighting system -IN PROGRESS-
Improved materials
This commit is contained in:
30
src/raylib.h
30
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)
|
||||
//----------------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user