Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2017-02-03 18:01:32 +0300
committerClément Foucault <foucault.clem@gmail.com>2017-02-03 18:01:32 +0300
commit520ced4ad504bfcbcf0e86ff07651736dc51b8f0 (patch)
tree94cac91b50c15cdb3df35704168cd194fdb5b299 /source/blender/gpu/intern/gpu_material.c
parentb1b5ded37f9e2967fb1e2b33c6aef89c233750ed (diff)
Modifications to GPU_texture:
-Remove NPOT check as it should be supported by default with OGL 3.3 -All custom texture creation follow the same path now -Now explicit texture format is required when creating a custom texture (Non RGBA8) -Support for arrays of textures Reviewers: dfelinto, merwin Differential Revision: https://developer.blender.org/D2452
Diffstat (limited to 'source/blender/gpu/intern/gpu_material.c')
-rw-r--r--source/blender/gpu/intern/gpu_material.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c
index b42efcca6b1..28cf7bd1c76 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -2369,6 +2369,11 @@ static void gpu_lamp_shadow_free(GPULamp *lamp)
}
}
+static GPUTexture *gpu_lamp_create_vsm_shadow_map(int size)
+{
+ return GPU_texture_create_2D_custom(size, size, 2, GPU_RG32F, NULL, NULL);
+}
+
GPULamp *GPU_lamp_from_blender(Scene *scene, Object *ob, Object *par)
{
Lamp *la;
@@ -2415,7 +2420,7 @@ GPULamp *GPU_lamp_from_blender(Scene *scene, Object *ob, Object *par)
}
/* Shadow color map */
- lamp->tex = GPU_texture_create_vsm_shadow_map(lamp->size, NULL);
+ lamp->tex = gpu_lamp_create_vsm_shadow_map(lamp->size);
if (!lamp->tex) {
gpu_lamp_shadow_free(lamp);
return lamp;
@@ -2438,7 +2443,7 @@ GPULamp *GPU_lamp_from_blender(Scene *scene, Object *ob, Object *par)
return lamp;
}
- lamp->blurtex = GPU_texture_create_vsm_shadow_map(lamp->size * 0.5, NULL);
+ lamp->blurtex = gpu_lamp_create_vsm_shadow_map(lamp->size * 0.5);
if (!lamp->blurtex) {
gpu_lamp_shadow_free(lamp);
return lamp;