summaryrefslogtreecommitdiffhomepage
path: root/examples/models/models_material_pbr.c
diff options
context:
space:
mode:
authorRay <[email protected]>2019-01-10 11:25:26 +0100
committerRay <[email protected]>2019-01-10 11:25:26 +0100
commit55f8dbc755c2e31d2112e71439fef0d31e8090a6 (patch)
treee55e8b27cf4ef488167acd7bac9ec8a62c92ac97 /examples/models/models_material_pbr.c
parent7c4a0f963dfc6f089337158ea6b78b84f4022368 (diff)
downloadraylib-55f8dbc755c2e31d2112e71439fef0d31e8090a6.tar.gz
raylib-55f8dbc755c2e31d2112e71439fef0d31e8090a6.zip
WARNING: Redesigned SetShaderValue()
Diffstat (limited to 'examples/models/models_material_pbr.c')
-rw-r--r--examples/models/models_material_pbr.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/examples/models/models_material_pbr.c b/examples/models/models_material_pbr.c
index 6885f753..f93c7a68 100644
--- a/examples/models/models_material_pbr.c
+++ b/examples/models/models_material_pbr.c
@@ -64,7 +64,7 @@ int main()
// Send to material PBR shader camera view position
float cameraPos[3] = { camera.position.x, camera.position.y, camera.position.z };
- SetShaderValue(model.material.shader, model.material.shader.locs[LOC_VECTOR_VIEW], cameraPos, 3);
+ SetShaderValue(model.material.shader, model.material.shader.locs[LOC_VECTOR_VIEW], cameraPos, UNIFORM_VEC3);
//----------------------------------------------------------------------------------
// Draw
@@ -148,9 +148,9 @@ static Material LoadMaterialPBR(Color albedo, float metalness, float roughness)
Shader shdrBRDF = LoadShader(PATH_BRDF_VS, PATH_BRDF_FS);
// Setup required shader locations
- SetShaderValuei(shdrCubemap, GetShaderLocation(shdrCubemap, "equirectangularMap"), (int[1]){ 0 }, 1);
- SetShaderValuei(shdrIrradiance, GetShaderLocation(shdrIrradiance, "environmentMap"), (int[1]){ 0 }, 1);
- SetShaderValuei(shdrPrefilter, GetShaderLocation(shdrPrefilter, "environmentMap"), (int[1]){ 0 }, 1);
+ SetShaderValue(shdrCubemap, GetShaderLocation(shdrCubemap, "equirectangularMap"), (int[1]){ 0 }, UNIFORM_INT);
+ SetShaderValue(shdrIrradiance, GetShaderLocation(shdrIrradiance, "environmentMap"), (int[1]){ 0 }, UNIFORM_INT);
+ SetShaderValue(shdrPrefilter, GetShaderLocation(shdrPrefilter, "environmentMap"), (int[1]){ 0 }, UNIFORM_INT);
Texture2D texHDR = LoadTexture("resources/dresden_square.hdr");
Texture2D cubemap = GenTextureCubemap(shdrCubemap, texHDR, CUBEMAP_SIZE);
@@ -174,14 +174,14 @@ static Material LoadMaterialPBR(Color albedo, float metalness, float roughness)
SetTextureFilter(mat.maps[MAP_OCCLUSION].texture, FILTER_BILINEAR);
// Enable sample usage in shader for assigned textures
- SetShaderValuei(mat.shader, GetShaderLocation(mat.shader, "albedo.useSampler"), (int[1]){ 1 }, 1);
- SetShaderValuei(mat.shader, GetShaderLocation(mat.shader, "normals.useSampler"), (int[1]){ 1 }, 1);
- SetShaderValuei(mat.shader, GetShaderLocation(mat.shader, "metalness.useSampler"), (int[1]){ 1 }, 1);
- SetShaderValuei(mat.shader, GetShaderLocation(mat.shader, "roughness.useSampler"), (int[1]){ 1 }, 1);
- SetShaderValuei(mat.shader, GetShaderLocation(mat.shader, "occlusion.useSampler"), (int[1]){ 1 }, 1);
+ SetShaderValue(mat.shader, GetShaderLocation(mat.shader, "albedo.useSampler"), (int[1]){ 1 }, UNIFORM_INT);
+ SetShaderValue(mat.shader, GetShaderLocation(mat.shader, "normals.useSampler"), (int[1]){ 1 }, UNIFORM_INT);
+ SetShaderValue(mat.shader, GetShaderLocation(mat.shader, "metalness.useSampler"), (int[1]){ 1 }, UNIFORM_INT);
+ SetShaderValue(mat.shader, GetShaderLocation(mat.shader, "roughness.useSampler"), (int[1]){ 1 }, UNIFORM_INT);
+ SetShaderValue(mat.shader, GetShaderLocation(mat.shader, "occlusion.useSampler"), (int[1]){ 1 }, UNIFORM_INT);
int renderModeLoc = GetShaderLocation(mat.shader, "renderMode");
- SetShaderValuei(mat.shader, renderModeLoc, (int[1]){ 0 }, 1);
+ SetShaderValue(mat.shader, renderModeLoc, (int[1]){ 0 }, UNIFORM_INT);
// Set up material properties color
mat.maps[MAP_ALBEDO].color = albedo;