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:
authorCampbell Barton <ideasman42@gmail.com>2010-09-27 11:01:08 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-09-27 11:01:08 +0400
commitdbd5524970eddd4170d0b37461648523f4ce5cd9 (patch)
tree656522862beb5bea49b1120032636abf41d7fb0b /source/blender/gpu
parent62c7786cd9fd39f5f58eb0cfe323116e7c7bdfab (diff)
show material hardness in solid shaded mode
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/intern/gpu_draw.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index 289f9fe5e8b..b7698dd3031 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -874,6 +874,7 @@ void GPU_free_images_anim(void)
typedef struct GPUMaterialFixed {
float diff[4];
float spec[4];
+ int hard;
} GPUMaterialFixed;
static struct GPUMaterialState {
@@ -921,7 +922,8 @@ static void gpu_material_to_fixed(GPUMaterialFixed *smat, const Material *bmat,
smat->spec[1]= bmat->spec * bmat->specg;
smat->spec[2]= bmat->spec * bmat->specb;
smat->spec[3]= 1.0; /* always 1 */
-
+ smat->hard= CLAMPIS(bmat->har, 0, 128);
+
if(gamma) {
linearrgb_to_srgb_v3_v3(smat->diff, smat->diff);
linearrgb_to_srgb_v3_v3(smat->spec, smat->spec);
@@ -1104,6 +1106,7 @@ int GPU_enable_material(int nr, void *attribs)
/* or do fixed function opengl material */
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, GMS.matbuf[nr].diff);
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, GMS.matbuf[nr].spec);
+ glMateriali(GL_FRONT_AND_BACK, GL_SHININESS, GMS.matbuf[nr].hard);
}
/* set (alpha) blending mode */