package org.helioviewer.gl3d.model.image;

import javax.media.opengl.GL;

import org.helioviewer.base.physics.Constants;
import org.helioviewer.gl3d.shader.GL3DImageVertexShaderProgram;
import org.helioviewer.gl3d.shader.GL3DShaderFactory;
import org.helioviewer.gl3d.view.GL3DView;
import org.helioviewer.viewmodel.view.opengl.shader.GLVertexShaderProgram;

public class GL3DAIAImageLayer extends GL3DImageLayer {
    private GL3DImageSphere sphere;

    public GL3DAIAImageLayer(GL3DView mainView) {
        super("AIA Image Layer", mainView);
    }

    @Override
    protected void createImageMeshNodes(GL gl) {
        this.sphereFragmentShader = imageTextureView.getFragmentShader();

        GL3DImageVertexShaderProgram vertex = new GL3DImageVertexShaderProgram();
        GLVertexShaderProgram vertexShader = GL3DShaderFactory.createVertexShaderProgram(gl, vertex);
        this.imageTextureView.setVertexShader(vertex);
        this.imageTextureView.metadata = this.metaDataView.getMetaData();

        sphere = new GL3DImageSphere(imageTextureView, vertexShader, sphereFragmentShader, this);

        this.sphereFragmentShader.setCutOffRadius((float) (Constants.SunRadius / this.imageTextureView.metadata.getPhysicalImageWidth()));

        this.addNode(sphere);
        this.gl = gl;
    }

    @Override
    protected GL3DImageMesh getImageSphere() {
        return this.sphere;
    }

}

@@ -71,55 +71,8 @@
 L;%0A%0A
-import org.helioviewer.base.physics.Constants;%0A
 impo
@@ -132,16 +132,16 @@
 rogram;%0A
+
 import o
@@ -632,25 +632,24 @@
 ntShader();%0A
-%0A
         GL3D
@@ -679,16 +679,29 @@
 m vertex
+ShaderProgram
  = new G
@@ -826,24 +826,37 @@
 m(gl, vertex
+ShaderProgram
 );%0A        t
@@ -898,16 +898,29 @@
 r(vertex
+ShaderProgram
 );%0A     
@@ -988,17 +988,16 @@
 Data();%0A
-%0A
         
@@ -1090,149 +1090,8 @@
 s);%0A
-%0A        this.sphereFragmentShader.setCutOffRadius((float) (Constants.SunRadius / this.imageTextureView.metadata.getPhysicalImageWidth()));%0A%0A
     
@@ -1120,30 +1120,8 @@
 e);%0A
-        this.gl = gl;%0A
     

Remove overhead