Commit 5025f529 authored by Edward Vigmond's avatar Edward Vigmond
Browse files

Fixed backlight updating with translucency.

parent a2226417
Pipeline #2582 passed with stages
in 61 minutes and 59 seconds
......@@ -422,10 +422,11 @@ TBmeshWin::draw_surfaces( RenderTris &rd, vector<vtx_z> &trans, bool wireframe )
bool translucent = false;
for ( int s=0; s<model->numSurf(); s++ ) {
Surfaces *sf = model->surface(s);
if(translucency( wireframe?SurfEle:Surface, wireframe?sf->outlinecolor():sf->fillcolor())){
GLfloat props[] = {sf->specular(), sf->diffuse(), sf->shiny(), sf->backlight()};
rd.set_material( s, props );
if(translucency( wireframe?SurfEle:Surface, wireframe?sf->outlinecolor():sf->fillcolor()))
translucent = true;
break;
}
}
if( translucent && rd.num()>MAX_SURFELE_REALTIME && _spinning ){
......@@ -455,9 +456,6 @@ TBmeshWin::draw_surfaces( RenderTris &rd, vector<vtx_z> &trans, bool wireframe )
Surfaces *sf = model->surface(sindex);
if ( !sf->visible() ) continue;
GLfloat props[] = {sf->specular(), sf->diffuse(), sf->shiny(), sf->backlight() };
rd.set_material( s, props );
if ( wireframe ? sf->outline() : sf->filled() ) {
if( newView ) {
if( draw_surface(sf, vbobuf, wireframe ) ) {
......
......@@ -125,7 +125,7 @@ class TBmeshWin:public Fl_Gl_Tb_Window
void region_vis( int *, int, bool *);
friend class Sequence;
void facetshade( bool a ){ facetshading=a;valid(0);redraw(VBO_Colour); }
void cull( bool c, int b=0 ){backface_culling=c;if(lit_bf!=b){lit_bf=b;illuminate(lightson);}valid(0);redraw(VBO_Lighting);}
void cull( bool c, int b=0 ){backface_culling=c;lit_bf=b;illuminate(lightson);valid(0);redraw(VBO_Lighting);}
void headlamp( bool a ){ headlamp_mode=a; redraw(); }
void surfVis( vector<int>&, bool );
void surfFilled( vector<int>&, bool );
......
......@@ -77,7 +77,8 @@ opacity->value( c[3] );} {}
}
}
class surfColourChoice {} {
class surfColourChoice {open
} {
Function {surfColourChoice( GLfloat *c, GLfloat *matprop, Fl_Check_Browser *cb, Object_t o, TBmeshWin *t )} {open
} {
Fl_Window window {
......@@ -163,7 +164,7 @@ tbmw->redraw(VBO_Lighting);}
tbmw->model->set_mat( r, diffuse->value(), specular->value(),
shiny->value(), back->value() );
}
tbmw->redraw(VBO_Lighting);}
tbmw->redraw(VBO_Lighting);} selected
xywh {65 388 150 27} type Horizontal labelsize 12 align 4 value 0.5 textsize 14
}
Fl_Value_Slider opacity {
......@@ -249,8 +250,7 @@ window->show();} {}
}
}
class AuxSurfColourChoice {open
} {
class AuxSurfColourChoice {} {
Function {AuxSurfColourChoice( GLfloat *c, GLfloat *matprop, TBmeshWin *t )} {open
} {
Fl_Window window {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment