Class286_Sub6(OpenGlToolkit var_ha_Sub2, Class83 class83) {
	super(var_ha_Sub2);
	aBoolean6266 = false;
	do {
	    try {
		aClass83_6268 = class83;
		if (((Class83) aClass83_6268).aClass258_Sub1_1443 == null
		    || !(((OpenGlToolkit) ((Class286) this).aHa_Sub2_3684)
			 .aBoolean7791)
		    || !(((OpenGlToolkit) ((Class286) this).aHa_Sub2_3684)
			 .aBoolean7783))
		    break;
		Class242 class242
		    = (WidgetVariable.method3249
		       (35633, -110, ((Class286) this).aHa_Sub2_3684,
			"uniform float time;\nuniform float scale;\nvarying vec3 wvVertex;\nvarying float waterDepth;\nvoid main() {\nwaterDepth = gl_MultiTexCoord0.z;\nvec4 ecVertex = gl_ModelViewMatrix*gl_Vertex;\nwvVertex.x = dot(gl_NormalMatrix[0], ecVertex.xyz);\nwvVertex.y = dot(gl_NormalMatrix[1], ecVertex.xyz);\nwvVertex.z = dot(gl_NormalMatrix[2], ecVertex.xyz);\ngl_TexCoord[0].x = dot(gl_TextureMatrix[0][0], gl_MultiTexCoord0)*scale;\ngl_TexCoord[0].y = dot(gl_TextureMatrix[0][1], gl_MultiTexCoord0)*scale;\ngl_TexCoord[0].z = time;\ngl_TexCoord[0].w = 1.0;\ngl_FogFragCoord = 1.0-clamp((gl_Fog.end+ecVertex.z)*gl_Fog.scale, 0.0, 1.0);\ngl_Position = ftransform();\n}\n"));
		Class242 class242_4_
		    = (WidgetVariable.method3249
		       (35632, -38, ((Class286) this).aHa_Sub2_3684,
			"varying vec3 wvVertex;\nvarying float waterDepth;\nuniform vec3 sunDir;\nuniform vec4 sunColour;\nuniform float sunExponent;\nuniform float breakWaterDepth;\nuniform float breakWaterOffset;\nuniform sampler3D normalSampler;\nuniform samplerCube envMapSampler;\nvoid main() {\nvec4 wnNormal = texture3D(normalSampler, gl_TexCoord[0].xyz).rbga;\nwnNormal.xyz = 2.0*wnNormal.xyz-1.0;\nvec3 wnVector = normalize(wvVertex);\nvec3 wnReflection = reflect(wnVector, wnNormal.xyz);\nvec3 envColour = textureCube(envMapSampler, wnReflection).rgb;\nvec4 specularColour = sunColour*pow(clamp(-dot(sunDir, wnReflection), 0.0, 1.0), sunExponent);\nfloat shoreFactor = clamp(waterDepth/breakWaterDepth-breakWaterOffset*wnNormal.w, 0.0, 1.0);\nfloat ndote = dot(wnVector, wnNormal.xyz);\nfloat fresnel = pow(1.0-abs(ndote), 2.0);\nvec4 surfaceColour = vec4(envColour, fresnel*shoreFactor)+specularColour*shoreFactor;\ngl_FragColor = vec4(mix(surfaceColour.rgb, gl_Fog.color.rgb, gl_FogFragCoord), surfaceColour.a);\n}\n"));
		aClass337_6274
		    = Class318_Sub1_Sub5_Sub2.method2493((((Class286) this)
							  .aHa_Sub2_3684),
							 -1,
							 (new Class242[]
							  { class242,
							    class242_4_ }));
		aBoolean6272 = aClass337_6274 != null;
	    } catch (RuntimeException runtimeexception) {
		throw Class348_Sub17.method2929(runtimeexception,
						("tia.<init>("
						 + (var_ha_Sub2 != null
						    ? "{...}" : "null")
						 + ','
						 + (class83 != null ? "{...}"
						    : "null")
						 + ')'));
	    }
	    break;
	} while (false);
    }