Fix alpha issues
Fix selection bug
This commit is contained in:
parent
701aa4b151
commit
cc8db8cc96
@ -102,9 +102,9 @@ public class RealisticRenderer extends RocketRenderer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderComponent(final GL2 gl, final RocketComponent c, final float alpha) {
|
public void renderComponent(final GL2 gl, final RocketComponent c, final float alpha) {
|
||||||
|
render(gl, cr.getGeometry(c, Surface.INSIDE), DefaultAppearance.getDefaultAppearance(c), true, 1.0f);
|
||||||
render(gl, cr.getGeometry(c, Surface.OUTSIDE), getAppearance(c), true, alpha);
|
render(gl, cr.getGeometry(c, Surface.OUTSIDE), getAppearance(c), true, alpha);
|
||||||
render(gl, cr.getGeometry(c, Surface.EDGES), getAppearance(c), false, alpha);
|
render(gl, cr.getGeometry(c, Surface.EDGES), getAppearance(c), false, alpha);
|
||||||
render(gl, cr.getGeometry(c, Surface.INSIDE), DefaultAppearance.getDefaultAppearance(c), true, alpha);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void render(GL2 gl, Geometry g, Appearance a, boolean decals, float alpha) {
|
private void render(GL2 gl, Geometry g, Appearance a, boolean decals, float alpha) {
|
||||||
|
@ -73,10 +73,7 @@ public abstract class RocketRenderer {
|
|||||||
pickParts.add(c);
|
pickParts.add(c);
|
||||||
|
|
||||||
if (isDrawnTransparent(c)) {
|
if (isDrawnTransparent(c)) {
|
||||||
gl.glEnable(GL.GL_CULL_FACE);
|
cr.getGeometry(c, Surface.INSIDE).render(gl);
|
||||||
gl.glCullFace(GL.GL_FRONT);
|
|
||||||
cr.getGeometry(c, Surface.ALL).render(gl);
|
|
||||||
gl.glDisable(GL.GL_CULL_FACE);
|
|
||||||
} else {
|
} else {
|
||||||
cr.getGeometry(c, Surface.ALL).render(gl);
|
cr.getGeometry(c, Surface.ALL).render(gl);
|
||||||
}
|
}
|
||||||
@ -134,6 +131,8 @@ public abstract class RocketRenderer {
|
|||||||
} // done with selection outline
|
} // done with selection outline
|
||||||
|
|
||||||
gl.glEnable(GL.GL_CULL_FACE);
|
gl.glEnable(GL.GL_CULL_FACE);
|
||||||
|
gl.glCullFace(GL.GL_BACK);
|
||||||
|
|
||||||
// Draw all inner components
|
// Draw all inner components
|
||||||
for (RocketComponent c : configuration) {
|
for (RocketComponent c : configuration) {
|
||||||
if (isDrawn(c)) {
|
if (isDrawn(c)) {
|
||||||
@ -142,13 +141,13 @@ public abstract class RocketRenderer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gl.glDisable(GL.GL_CULL_FACE);
|
//gl.glDisable(GL.GL_CULL_FACE);
|
||||||
|
|
||||||
renderMotors(gl, configuration);
|
renderMotors(gl, configuration);
|
||||||
|
|
||||||
// Draw Tube and Transition back faces, blended with depth test
|
// Draw Tube and Transition back faces, blended with depth test
|
||||||
// so that they show up behind.
|
// so that they show up behind.
|
||||||
gl.glEnable(GL.GL_CULL_FACE);
|
/*gl.glEnable(GL.GL_CULL_FACE);
|
||||||
gl.glCullFace(GL.GL_FRONT);
|
gl.glCullFace(GL.GL_FRONT);
|
||||||
for (RocketComponent c : configuration) {
|
for (RocketComponent c : configuration) {
|
||||||
if (isDrawn(c)) {
|
if (isDrawn(c)) {
|
||||||
@ -158,11 +157,12 @@ public abstract class RocketRenderer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
gl.glDisable(GL.GL_CULL_FACE);
|
gl.glDisable(GL.GL_CULL_FACE);
|
||||||
|
*/
|
||||||
|
|
||||||
// Draw T&T front faces blended, without depth test
|
// Draw T&T front faces blended, without depth test
|
||||||
gl.glEnable(GL.GL_BLEND);
|
gl.glEnable(GL.GL_BLEND);
|
||||||
gl.glEnable(GL.GL_CULL_FACE);
|
//gl.glEnable(GL.GL_CULL_FACE);
|
||||||
gl.glCullFace(GL.GL_BACK);
|
//gl.glCullFace(GL.GL_BACK);
|
||||||
for (RocketComponent c : configuration) {
|
for (RocketComponent c : configuration) {
|
||||||
if (isDrawn(c)) {
|
if (isDrawn(c)) {
|
||||||
if (isDrawnTransparent(c)) {
|
if (isDrawnTransparent(c)) {
|
||||||
@ -171,7 +171,7 @@ public abstract class RocketRenderer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
gl.glDisable(GL.GL_BLEND);
|
gl.glDisable(GL.GL_BLEND);
|
||||||
gl.glDisable(GL.GL_CULL_FACE);
|
//gl.glDisable(GL.GL_CULL_FACE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user