/* Class138 - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
import jaggl.OpenGL;

public class Class138 {
	Class157 aClass157_1747;
	Class84_Sub3 aClass84_Sub3_1748;
	static final String aString1749 = "uniform float rcpRelief;\nuniform vec2 sampleSize;\nuniform sampler3D heightMap;\nvoid main() {\nfloat dx = texture3D(heightMap, vec3(-sampleSize.x, 0.0, 0.0)+gl_TexCoord[0].xyz).r - texture3D(heightMap, vec3(sampleSize.x, 0.0, 0.0)+gl_TexCoord[0].xyz).r;\nfloat dy = texture3D(heightMap, vec3(0.0, -sampleSize.y, 0.0)+gl_TexCoord[0].xyz).r - texture3D(heightMap, vec3(0.0, sampleSize.y, 0.0)+gl_TexCoord[0].xyz).r;\ngl_FragColor = vec4(0.5+normalize(vec3(dx, dy, rcpRelief))*0.5, texture3D(heightMap, gl_TexCoord[0].xyz).r);\n}\n";

	Class138(Class84_Sub3 class84_sub3) {
		((Class138) this).aClass84_Sub3_1748 = class84_sub3;
	}

	boolean method3181() {
		if (((Class84_Sub3) ((Class138) this).aClass84_Sub3_1748).aBool9453 && ((Class84_Sub3) ((Class138) this).aClass84_Sub3_1748).aBool9368 && ((Class138) this).aClass157_1747 == null) {
			Class142 class142 = (Class142.method3296(((Class138) this).aClass84_Sub3_1748, 35632, "uniform float rcpRelief;\nuniform vec2 sampleSize;\nuniform sampler3D heightMap;\nvoid main() {\nfloat dx = texture3D(heightMap, vec3(-sampleSize.x, 0.0, 0.0)+gl_TexCoord[0].xyz).r - texture3D(heightMap, vec3(sampleSize.x, 0.0, 0.0)+gl_TexCoord[0].xyz).r;\nfloat dy = texture3D(heightMap, vec3(0.0, -sampleSize.y, 0.0)+gl_TexCoord[0].xyz).r - texture3D(heightMap, vec3(0.0, sampleSize.y, 0.0)+gl_TexCoord[0].xyz).r;\ngl_FragColor = vec4(0.5+normalize(vec3(dx, dy, rcpRelief))*0.5, texture3D(heightMap, gl_TexCoord[0].xyz).r);\n}\n"));
			if (class142 != null)
				((Class138) this).aClass157_1747 = Class157.method3457(((Class138) this).aClass84_Sub3_1748, new Class142[] { class142 });
		}
		return ((Class138) this).aClass157_1747 != null;
	}

	boolean method3182(Class145_Sub3 class145_sub3, Class145_Sub3 class145_sub3_0_, float f) {
		if (!method3181())
			return false;
		Class171_Sub1_Sub3 class171_sub1_sub3 = (((Class84_Sub3) ((Class138) this).aClass84_Sub3_1748).aClass171_Sub1_Sub3_9475);
		Class587_Sub34_Sub17 class587_sub34_sub17 = new Class587_Sub34_Sub17(((Class138) this).aClass84_Sub3_1748, Class172.aClass172_2145, Class96.aClass96_1386, (((Class145_Sub3) class145_sub3).anInt10268), (((Class145_Sub3) class145_sub3).anInt10267));
		boolean bool = false;
		((Class138) this).aClass84_Sub3_1748.method1895(class171_sub1_sub3, (byte) 61);
		class171_sub1_sub3.method14732(0, class587_sub34_sub17);
		if (class171_sub1_sub3.method14731()) {
			OpenGL.glPushMatrix();
			OpenGL.glLoadIdentity();
			OpenGL.glMatrixMode(5889);
			OpenGL.glPushMatrix();
			OpenGL.glLoadIdentity();
			OpenGL.glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
			OpenGL.glPushAttrib(2048);
			OpenGL.glViewport(0, 0, ((Class145_Sub3) class145_sub3).anInt10268, ((Class145_Sub3) class145_sub3).anInt10267);
			OpenGL.glUseProgram(((Class157) ((Class138) this).aClass157_1747).anInt1879);
			OpenGL.glUniform1i(OpenGL.glGetUniformLocation((((Class157) (((Class138) this).aClass157_1747)).anInt1879), "heightMap"), 0);
			OpenGL.glUniform1f(OpenGL.glGetUniformLocation((((Class157) (((Class138) this).aClass157_1747)).anInt1879), "rcpRelief"), 1.0F / f);
			OpenGL.glUniform2f(OpenGL.glGetUniformLocation((((Class157) (((Class138) this).aClass157_1747)).anInt1879), "sampleSize"), 1.0F / (float) ((Class145_Sub3) class145_sub3_0_).anInt10268, 1.0F / (float) ((Class145_Sub3) class145_sub3_0_).anInt10267);
			for (int i = 0; i < ((Class145_Sub3) class145_sub3).anInt10269; i++) {
				float f_1_ = ((float) i / (float) ((Class145_Sub3) class145_sub3).anInt10269);
				((Class138) this).aClass84_Sub3_1748.method15440(class145_sub3_0_);
				OpenGL.glBegin(7);
				OpenGL.glTexCoord3f(0.0F, 0.0F, f_1_);
				OpenGL.glVertex2f(0.0F, 0.0F);
				OpenGL.glTexCoord3f(1.0F, 0.0F, f_1_);
				OpenGL.glVertex2f(1.0F, 0.0F);
				OpenGL.glTexCoord3f(1.0F, 1.0F, f_1_);
				OpenGL.glVertex2f(1.0F, 1.0F);
				OpenGL.glTexCoord3f(0.0F, 1.0F, f_1_);
				OpenGL.glVertex2f(0.0F, 1.0F);
				OpenGL.glEnd();
				class145_sub3.method16488(0, 0, i, ((Class145_Sub3) class145_sub3).anInt10268, ((Class145_Sub3) class145_sub3).anInt10267, 0, 0);
			}
			OpenGL.glUseProgram(0);
			OpenGL.glPopAttrib();
			OpenGL.glPopMatrix();
			OpenGL.glMatrixMode(5888);
			OpenGL.glPopMatrix();
			bool = true;
		}
		class171_sub1_sub3.method14732(0, null);
		((Class138) this).aClass84_Sub3_1748.method1896(class171_sub1_sub3, -45271581);
		return bool;
	}

	boolean method3183() {
		if (((Class84_Sub3) ((Class138) this).aClass84_Sub3_1748).aBool9453 && ((Class84_Sub3) ((Class138) this).aClass84_Sub3_1748).aBool9368 && ((Class138) this).aClass157_1747 == null) {
			Class142 class142 = (Class142.method3296(((Class138) this).aClass84_Sub3_1748, 35632, "uniform float rcpRelief;\nuniform vec2 sampleSize;\nuniform sampler3D heightMap;\nvoid main() {\nfloat dx = texture3D(heightMap, vec3(-sampleSize.x, 0.0, 0.0)+gl_TexCoord[0].xyz).r - texture3D(heightMap, vec3(sampleSize.x, 0.0, 0.0)+gl_TexCoord[0].xyz).r;\nfloat dy = texture3D(heightMap, vec3(0.0, -sampleSize.y, 0.0)+gl_TexCoord[0].xyz).r - texture3D(heightMap, vec3(0.0, sampleSize.y, 0.0)+gl_TexCoord[0].xyz).r;\ngl_FragColor = vec4(0.5+normalize(vec3(dx, dy, rcpRelief))*0.5, texture3D(heightMap, gl_TexCoord[0].xyz).r);\n}\n"));
			if (class142 != null)
				((Class138) this).aClass157_1747 = Class157.method3457(((Class138) this).aClass84_Sub3_1748, new Class142[] { class142 });
		}
		return ((Class138) this).aClass157_1747 != null;
	}

	boolean method3184() {
		if (((Class84_Sub3) ((Class138) this).aClass84_Sub3_1748).aBool9453 && ((Class84_Sub3) ((Class138) this).aClass84_Sub3_1748).aBool9368 && ((Class138) this).aClass157_1747 == null) {
			Class142 class142 = (Class142.method3296(((Class138) this).aClass84_Sub3_1748, 35632, "uniform float rcpRelief;\nuniform vec2 sampleSize;\nuniform sampler3D heightMap;\nvoid main() {\nfloat dx = texture3D(heightMap, vec3(-sampleSize.x, 0.0, 0.0)+gl_TexCoord[0].xyz).r - texture3D(heightMap, vec3(sampleSize.x, 0.0, 0.0)+gl_TexCoord[0].xyz).r;\nfloat dy = texture3D(heightMap, vec3(0.0, -sampleSize.y, 0.0)+gl_TexCoord[0].xyz).r - texture3D(heightMap, vec3(0.0, sampleSize.y, 0.0)+gl_TexCoord[0].xyz).r;\ngl_FragColor = vec4(0.5+normalize(vec3(dx, dy, rcpRelief))*0.5, texture3D(heightMap, gl_TexCoord[0].xyz).r);\n}\n"));
			if (class142 != null)
				((Class138) this).aClass157_1747 = Class157.method3457(((Class138) this).aClass84_Sub3_1748, new Class142[] { class142 });
		}
		return ((Class138) this).aClass157_1747 != null;
	}

	boolean method3185() {
		if (((Class84_Sub3) ((Class138) this).aClass84_Sub3_1748).aBool9453 && ((Class84_Sub3) ((Class138) this).aClass84_Sub3_1748).aBool9368 && ((Class138) this).aClass157_1747 == null) {
			Class142 class142 = (Class142.method3296(((Class138) this).aClass84_Sub3_1748, 35632, "uniform float rcpRelief;\nuniform vec2 sampleSize;\nuniform sampler3D heightMap;\nvoid main() {\nfloat dx = texture3D(heightMap, vec3(-sampleSize.x, 0.0, 0.0)+gl_TexCoord[0].xyz).r - texture3D(heightMap, vec3(sampleSize.x, 0.0, 0.0)+gl_TexCoord[0].xyz).r;\nfloat dy = texture3D(heightMap, vec3(0.0, -sampleSize.y, 0.0)+gl_TexCoord[0].xyz).r - texture3D(heightMap, vec3(0.0, sampleSize.y, 0.0)+gl_TexCoord[0].xyz).r;\ngl_FragColor = vec4(0.5+normalize(vec3(dx, dy, rcpRelief))*0.5, texture3D(heightMap, gl_TexCoord[0].xyz).r);\n}\n"));
			if (class142 != null)
				((Class138) this).aClass157_1747 = Class157.method3457(((Class138) this).aClass84_Sub3_1748, new Class142[] { class142 });
		}
		return ((Class138) this).aClass157_1747 != null;
	}

	boolean method3186(Class145_Sub3 class145_sub3, Class145_Sub3 class145_sub3_2_, float f) {
		if (!method3181())
			return false;
		Class171_Sub1_Sub3 class171_sub1_sub3 = (((Class84_Sub3) ((Class138) this).aClass84_Sub3_1748).aClass171_Sub1_Sub3_9475);
		Class587_Sub34_Sub17 class587_sub34_sub17 = new Class587_Sub34_Sub17(((Class138) this).aClass84_Sub3_1748, Class172.aClass172_2145, Class96.aClass96_1386, (((Class145_Sub3) class145_sub3).anInt10268), (((Class145_Sub3) class145_sub3).anInt10267));
		boolean bool = false;
		((Class138) this).aClass84_Sub3_1748.method1895(class171_sub1_sub3, (byte) 37);
		class171_sub1_sub3.method14732(0, class587_sub34_sub17);
		if (class171_sub1_sub3.method14731()) {
			OpenGL.glPushMatrix();
			OpenGL.glLoadIdentity();
			OpenGL.glMatrixMode(5889);
			OpenGL.glPushMatrix();
			OpenGL.glLoadIdentity();
			OpenGL.glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
			OpenGL.glPushAttrib(2048);
			OpenGL.glViewport(0, 0, ((Class145_Sub3) class145_sub3).anInt10268, ((Class145_Sub3) class145_sub3).anInt10267);
			OpenGL.glUseProgram(((Class157) ((Class138) this).aClass157_1747).anInt1879);
			OpenGL.glUniform1i(OpenGL.glGetUniformLocation((((Class157) (((Class138) this).aClass157_1747)).anInt1879), "heightMap"), 0);
			OpenGL.glUniform1f(OpenGL.glGetUniformLocation((((Class157) (((Class138) this).aClass157_1747)).anInt1879), "rcpRelief"), 1.0F / f);
			OpenGL.glUniform2f(OpenGL.glGetUniformLocation((((Class157) (((Class138) this).aClass157_1747)).anInt1879), "sampleSize"), 1.0F / (float) ((Class145_Sub3) class145_sub3_2_).anInt10268, 1.0F / (float) ((Class145_Sub3) class145_sub3_2_).anInt10267);
			for (int i = 0; i < ((Class145_Sub3) class145_sub3).anInt10269; i++) {
				float f_3_ = ((float) i / (float) ((Class145_Sub3) class145_sub3).anInt10269);
				((Class138) this).aClass84_Sub3_1748.method15440(class145_sub3_2_);
				OpenGL.glBegin(7);
				OpenGL.glTexCoord3f(0.0F, 0.0F, f_3_);
				OpenGL.glVertex2f(0.0F, 0.0F);
				OpenGL.glTexCoord3f(1.0F, 0.0F, f_3_);
				OpenGL.glVertex2f(1.0F, 0.0F);
				OpenGL.glTexCoord3f(1.0F, 1.0F, f_3_);
				OpenGL.glVertex2f(1.0F, 1.0F);
				OpenGL.glTexCoord3f(0.0F, 1.0F, f_3_);
				OpenGL.glVertex2f(0.0F, 1.0F);
				OpenGL.glEnd();
				class145_sub3.method16488(0, 0, i, ((Class145_Sub3) class145_sub3).anInt10268, ((Class145_Sub3) class145_sub3).anInt10267, 0, 0);
			}
			OpenGL.glUseProgram(0);
			OpenGL.glPopAttrib();
			OpenGL.glPopMatrix();
			OpenGL.glMatrixMode(5888);
			OpenGL.glPopMatrix();
			bool = true;
		}
		class171_sub1_sub3.method14732(0, null);
		((Class138) this).aClass84_Sub3_1748.method1896(class171_sub1_sub3, -45271581);
		return bool;
	}

	boolean method3187(Class145_Sub3 class145_sub3, Class145_Sub3 class145_sub3_4_, float f) {
		if (!method3181())
			return false;
		Class171_Sub1_Sub3 class171_sub1_sub3 = (((Class84_Sub3) ((Class138) this).aClass84_Sub3_1748).aClass171_Sub1_Sub3_9475);
		Class587_Sub34_Sub17 class587_sub34_sub17 = new Class587_Sub34_Sub17(((Class138) this).aClass84_Sub3_1748, Class172.aClass172_2145, Class96.aClass96_1386, (((Class145_Sub3) class145_sub3).anInt10268), (((Class145_Sub3) class145_sub3).anInt10267));
		boolean bool = false;
		((Class138) this).aClass84_Sub3_1748.method1895(class171_sub1_sub3, (byte) 30);
		class171_sub1_sub3.method14732(0, class587_sub34_sub17);
		if (class171_sub1_sub3.method14731()) {
			OpenGL.glPushMatrix();
			OpenGL.glLoadIdentity();
			OpenGL.glMatrixMode(5889);
			OpenGL.glPushMatrix();
			OpenGL.glLoadIdentity();
			OpenGL.glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
			OpenGL.glPushAttrib(2048);
			OpenGL.glViewport(0, 0, ((Class145_Sub3) class145_sub3).anInt10268, ((Class145_Sub3) class145_sub3).anInt10267);
			OpenGL.glUseProgram(((Class157) ((Class138) this).aClass157_1747).anInt1879);
			OpenGL.glUniform1i(OpenGL.glGetUniformLocation((((Class157) (((Class138) this).aClass157_1747)).anInt1879), "heightMap"), 0);
			OpenGL.glUniform1f(OpenGL.glGetUniformLocation((((Class157) (((Class138) this).aClass157_1747)).anInt1879), "rcpRelief"), 1.0F / f);
			OpenGL.glUniform2f(OpenGL.glGetUniformLocation((((Class157) (((Class138) this).aClass157_1747)).anInt1879), "sampleSize"), 1.0F / (float) ((Class145_Sub3) class145_sub3_4_).anInt10268, 1.0F / (float) ((Class145_Sub3) class145_sub3_4_).anInt10267);
			for (int i = 0; i < ((Class145_Sub3) class145_sub3).anInt10269; i++) {
				float f_5_ = ((float) i / (float) ((Class145_Sub3) class145_sub3).anInt10269);
				((Class138) this).aClass84_Sub3_1748.method15440(class145_sub3_4_);
				OpenGL.glBegin(7);
				OpenGL.glTexCoord3f(0.0F, 0.0F, f_5_);
				OpenGL.glVertex2f(0.0F, 0.0F);
				OpenGL.glTexCoord3f(1.0F, 0.0F, f_5_);
				OpenGL.glVertex2f(1.0F, 0.0F);
				OpenGL.glTexCoord3f(1.0F, 1.0F, f_5_);
				OpenGL.glVertex2f(1.0F, 1.0F);
				OpenGL.glTexCoord3f(0.0F, 1.0F, f_5_);
				OpenGL.glVertex2f(0.0F, 1.0F);
				OpenGL.glEnd();
				class145_sub3.method16488(0, 0, i, ((Class145_Sub3) class145_sub3).anInt10268, ((Class145_Sub3) class145_sub3).anInt10267, 0, 0);
			}
			OpenGL.glUseProgram(0);
			OpenGL.glPopAttrib();
			OpenGL.glPopMatrix();
			OpenGL.glMatrixMode(5888);
			OpenGL.glPopMatrix();
			bool = true;
		}
		class171_sub1_sub3.method14732(0, null);
		((Class138) this).aClass84_Sub3_1748.method1896(class171_sub1_sub3, -45271581);
		return bool;
	}

	boolean method3188() {
		if (((Class84_Sub3) ((Class138) this).aClass84_Sub3_1748).aBool9453 && ((Class84_Sub3) ((Class138) this).aClass84_Sub3_1748).aBool9368 && ((Class138) this).aClass157_1747 == null) {
			Class142 class142 = (Class142.method3296(((Class138) this).aClass84_Sub3_1748, 35632, "uniform float rcpRelief;\nuniform vec2 sampleSize;\nuniform sampler3D heightMap;\nvoid main() {\nfloat dx = texture3D(heightMap, vec3(-sampleSize.x, 0.0, 0.0)+gl_TexCoord[0].xyz).r - texture3D(heightMap, vec3(sampleSize.x, 0.0, 0.0)+gl_TexCoord[0].xyz).r;\nfloat dy = texture3D(heightMap, vec3(0.0, -sampleSize.y, 0.0)+gl_TexCoord[0].xyz).r - texture3D(heightMap, vec3(0.0, sampleSize.y, 0.0)+gl_TexCoord[0].xyz).r;\ngl_FragColor = vec4(0.5+normalize(vec3(dx, dy, rcpRelief))*0.5, texture3D(heightMap, gl_TexCoord[0].xyz).r);\n}\n"));
			if (class142 != null)
				((Class138) this).aClass157_1747 = Class157.method3457(((Class138) this).aClass84_Sub3_1748, new Class142[] { class142 });
		}
		return ((Class138) this).aClass157_1747 != null;
	}

	boolean method3189(Class145_Sub3 class145_sub3, Class145_Sub3 class145_sub3_6_, float f) {
		if (!method3181())
			return false;
		Class171_Sub1_Sub3 class171_sub1_sub3 = (((Class84_Sub3) ((Class138) this).aClass84_Sub3_1748).aClass171_Sub1_Sub3_9475);
		Class587_Sub34_Sub17 class587_sub34_sub17 = new Class587_Sub34_Sub17(((Class138) this).aClass84_Sub3_1748, Class172.aClass172_2145, Class96.aClass96_1386, (((Class145_Sub3) class145_sub3).anInt10268), (((Class145_Sub3) class145_sub3).anInt10267));
		boolean bool = false;
		((Class138) this).aClass84_Sub3_1748.method1895(class171_sub1_sub3, (byte) 6);
		class171_sub1_sub3.method14732(0, class587_sub34_sub17);
		if (class171_sub1_sub3.method14731()) {
			OpenGL.glPushMatrix();
			OpenGL.glLoadIdentity();
			OpenGL.glMatrixMode(5889);
			OpenGL.glPushMatrix();
			OpenGL.glLoadIdentity();
			OpenGL.glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
			OpenGL.glPushAttrib(2048);
			OpenGL.glViewport(0, 0, ((Class145_Sub3) class145_sub3).anInt10268, ((Class145_Sub3) class145_sub3).anInt10267);
			OpenGL.glUseProgram(((Class157) ((Class138) this).aClass157_1747).anInt1879);
			OpenGL.glUniform1i(OpenGL.glGetUniformLocation((((Class157) (((Class138) this).aClass157_1747)).anInt1879), "heightMap"), 0);
			OpenGL.glUniform1f(OpenGL.glGetUniformLocation((((Class157) (((Class138) this).aClass157_1747)).anInt1879), "rcpRelief"), 1.0F / f);
			OpenGL.glUniform2f(OpenGL.glGetUniformLocation((((Class157) (((Class138) this).aClass157_1747)).anInt1879), "sampleSize"), 1.0F / (float) ((Class145_Sub3) class145_sub3_6_).anInt10268, 1.0F / (float) ((Class145_Sub3) class145_sub3_6_).anInt10267);
			for (int i = 0; i < ((Class145_Sub3) class145_sub3).anInt10269; i++) {
				float f_7_ = ((float) i / (float) ((Class145_Sub3) class145_sub3).anInt10269);
				((Class138) this).aClass84_Sub3_1748.method15440(class145_sub3_6_);
				OpenGL.glBegin(7);
				OpenGL.glTexCoord3f(0.0F, 0.0F, f_7_);
				OpenGL.glVertex2f(0.0F, 0.0F);
				OpenGL.glTexCoord3f(1.0F, 0.0F, f_7_);
				OpenGL.glVertex2f(1.0F, 0.0F);
				OpenGL.glTexCoord3f(1.0F, 1.0F, f_7_);
				OpenGL.glVertex2f(1.0F, 1.0F);
				OpenGL.glTexCoord3f(0.0F, 1.0F, f_7_);
				OpenGL.glVertex2f(0.0F, 1.0F);
				OpenGL.glEnd();
				class145_sub3.method16488(0, 0, i, ((Class145_Sub3) class145_sub3).anInt10268, ((Class145_Sub3) class145_sub3).anInt10267, 0, 0);
			}
			OpenGL.glUseProgram(0);
			OpenGL.glPopAttrib();
			OpenGL.glPopMatrix();
			OpenGL.glMatrixMode(5888);
			OpenGL.glPopMatrix();
			bool = true;
		}
		class171_sub1_sub3.method14732(0, null);
		((Class138) this).aClass84_Sub3_1748.method1896(class171_sub1_sub3, -45271581);
		return bool;
	}
}
