diff options
| author | raysan5 <[email protected]> | 2017-07-19 10:09:34 +0200 |
|---|---|---|
| committer | raysan5 <[email protected]> | 2017-07-19 10:09:34 +0200 |
| commit | d368403a131522a53c0dedd1ae4f24301898e96e (patch) | |
| tree | a2b92ba988d4d3c6d7cc8d489b94632b449d578e /examples | |
| parent | 8f569e59b177e879fe350027a706c6f731f86c4a (diff) | |
| download | raylib-d368403a131522a53c0dedd1ae4f24301898e96e.tar.gz raylib-d368403a131522a53c0dedd1ae4f24301898e96e.zip | |
Working on PBR materials, renamed some data
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/models/models_cubicmap.c | 2 | ||||
| -rw-r--r-- | examples/models/models_material_pbr.c | 20 | ||||
| -rw-r--r-- | examples/models/models_skybox.c | 6 |
3 files changed, 14 insertions, 14 deletions
diff --git a/examples/models/models_cubicmap.c b/examples/models/models_cubicmap.c index 8abc7d48..177cf890 100644 --- a/examples/models/models_cubicmap.c +++ b/examples/models/models_cubicmap.c @@ -31,7 +31,7 @@ int main() // NOTE: By default each cube is mapped to one part of texture atlas Texture2D texture = LoadTexture("resources/cubicmap_atlas.png"); // Load map texture - model.material.maps[TEXMAP_DIFFUSE].tex = texture; // Set map diffuse texture + model.material.maps[MAP_DIFFUSE].texture = texture; // Set map diffuse texture Vector3 mapPosition = { -16.0f, 0.0f, -8.0f }; // Set model position diff --git a/examples/models/models_material_pbr.c b/examples/models/models_material_pbr.c index 9380bd91..5761b2af 100644 --- a/examples/models/models_material_pbr.c +++ b/examples/models/models_material_pbr.c @@ -58,18 +58,18 @@ int main() Texture2D texHDR = LoadTexture("resources/pinetree.hdr"); model.material = LoadMaterialPBR(texHDR, (Color){ 255, 255, 255, 255 }, 1.0f, 1.0f); - SetMaterialTexture(&model.material, TEXMAP_ALBEDO, LoadTexture("resources/pbr/trooper_albedo.png")); - SetMaterialTexture(&model.material, TEXMAP_NORMAL, LoadTexture("resources/pbr/trooper_normals.png")); - SetMaterialTexture(&model.material, TEXMAP_METALNESS, LoadTexture("resources/pbr/trooper_metalness.png")); - SetMaterialTexture(&model.material, TEXMAP_ROUGHNESS, LoadTexture("resources/pbr/trooper_roughness.png")); - SetMaterialTexture(&model.material, TEXMAP_OCCLUSION, LoadTexture("resources/pbr/trooper_ao.png")); + SetMaterialTexture(&model.material, MAP_ALBEDO, LoadTexture("resources/pbr/trooper_albedo.png")); + SetMaterialTexture(&model.material, MAP_NORMAL, LoadTexture("resources/pbr/trooper_normals.png")); + SetMaterialTexture(&model.material, MAP_METALNESS, LoadTexture("resources/pbr/trooper_metalness.png")); + SetMaterialTexture(&model.material, MAP_ROUGHNESS, LoadTexture("resources/pbr/trooper_roughness.png")); + SetMaterialTexture(&model.material, MAP_OCCLUSION, LoadTexture("resources/pbr/trooper_ao.png")); // Set textures filtering for better quality - SetTextureFilter(model.material.maps[TEXMAP_ALBEDO].tex, FILTER_BILINEAR); - SetTextureFilter(model.material.maps[TEXMAP_NORMAL].tex, FILTER_BILINEAR); - SetTextureFilter(model.material.maps[TEXMAP_METALNESS].tex, FILTER_BILINEAR); - SetTextureFilter(model.material.maps[TEXMAP_ROUGHNESS].tex, FILTER_BILINEAR); - SetTextureFilter(model.material.maps[TEXMAP_OCCLUSION].tex, FILTER_BILINEAR); + SetTextureFilter(model.material.maps[MAP_ALBEDO].texture, FILTER_BILINEAR); + SetTextureFilter(model.material.maps[MAP_NORMAL].texture, FILTER_BILINEAR); + SetTextureFilter(model.material.maps[MAP_METALNESS].texture, FILTER_BILINEAR); + SetTextureFilter(model.material.maps[MAP_ROUGHNESS].texture, FILTER_BILINEAR); + SetTextureFilter(model.material.maps[MAP_OCCLUSION].texture, FILTER_BILINEAR); int renderModeLoc = GetShaderLocation(model.material.shader, "renderMode"); SetShaderValuei(model.material.shader, renderModeLoc, (int[1]){ 0 }, 1); diff --git a/examples/models/models_skybox.c b/examples/models/models_skybox.c index 8b302b1c..d347854f 100644 --- a/examples/models/models_skybox.c +++ b/examples/models/models_skybox.c @@ -30,8 +30,8 @@ int main() skybox.material.shader = LoadShader("resources/shaders/skybox.vs", "resources/shaders/skybox.fs"); Texture2D texHDR = LoadTexture("resources/pinetree.hdr"); - skybox.material.maps[TEXMAP_CUBEMAP].tex = rlGenMapCubemap(texHDR, 512); - SetShaderValuei(skybox.material.shader, GetShaderLocation(skybox.material.shader, "environmentMap"), (int[1]){ TEXMAP_CUBEMAP }, 1); + skybox.material.maps[MAP_CUBEMAP].texture = GenTextureCubemap(texHDR, 512); + SetShaderValuei(skybox.material.shader, GetShaderLocation(skybox.material.shader, "environmentMap"), (int[1]){ MAP_CUBEMAP }, 1); // Get skybox shader locations skybox.material.shader.locs[LOC_MATRIX_PROJECTION] = GetShaderLocation(skybox.material.shader, "projection"); @@ -66,7 +66,7 @@ int main() Begin3dMode(camera); - DrawModel(skybox, VectorZero(), 1.0f, RED); + DrawModel(skybox, VectorZero(), 1.0f, WHITE); DrawGrid(10, 1.0f); |
