Skip to content

Commit

Permalink
Fixed backface culling in proxy mode.
Browse files Browse the repository at this point in the history
Back side faces was not shown in proxy work mode, when there where
hidden/hole faces in the model.

NOTE: Fixed various hidden/hole face drawing problems. Hidden hard
edges was drawn reported by Ania. Smooth-preview showed edges on
hidden faces and the backside of visible faces was not shown in flat
shaded view.
  • Loading branch information
dgud authored and bjorng committed Dec 5, 2009
1 parent d59426b commit 21621f2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/wings_proxy.erl
Expand Up @@ -223,7 +223,7 @@ draw(#dlo{proxy_data=#sp{faces=Dl},drag=none}=D, Wire, SceneLights) ->
draw(#dlo{proxy_data=#sp{faces=Dl}}=D, _Wire, SceneLights) -> draw(#dlo{proxy_data=#sp{faces=Dl}}=D, _Wire, SceneLights) ->
draw_1(D, Dl, true, proxy_moving_opacity, cage, SceneLights). draw_1(D, Dl, true, proxy_moving_opacity, cage, SceneLights).


draw_1(D, Dl, Wire, Key, EdgeStyleKey, SceneLights) -> draw_1(#dlo{src_we=We} = D, Dl, Wire, Key, EdgeStyleKey, SceneLights) ->
gl:shadeModel(?GL_SMOOTH), gl:shadeModel(?GL_SMOOTH),
wings_render:enable_lighting(SceneLights), wings_render:enable_lighting(SceneLights),
gl:enable(?GL_POLYGON_OFFSET_FILL), gl:enable(?GL_POLYGON_OFFSET_FILL),
Expand All @@ -240,7 +240,12 @@ draw_1(D, Dl, Wire, Key, EdgeStyleKey, SceneLights) ->
gl:blendColor(0, 0, 0, Opacity) gl:blendColor(0, 0, 0, Opacity)
end end
end, end,
case wings_we:is_open(We) of
true -> gl:disable(?GL_CULL_FACE);
false -> ignore
end,
wings_dl:call(Dl), wings_dl:call(Dl),
gl:enable(?GL_CULL_FACE),
gl:disable(?GL_POLYGON_OFFSET_FILL), gl:disable(?GL_POLYGON_OFFSET_FILL),
wings_render:disable_lighting(), wings_render:disable_lighting(),
gl:shadeModel(?GL_FLAT), gl:shadeModel(?GL_FLAT),
Expand Down

0 comments on commit 21621f2

Please sign in to comment.