
-- this is experimental new alternative maze ceiling, BUT:
-- in order to see, we must not draw maze ceilings !!!
-- Simply convert droomobj to troomobj (without top)...

-- OTOH, default ceilings are themselves interesting?



	near_success:=false;
	if chapter=1 then
		if schalice=1 or schalice=2 or (scene=1 and chaliceheld) then
			near_success:=true;
		end if;
	elsif chapter=2 then
		if schalice=1 or schalice=2 or (scene=1 and chaliceheld) then
			near_success:=true;
		end if;
	elsif chapter=3 then
		if schalice=1 or schalice=2 or (scene=1 and chaliceheld) then
			near_success:=true;
		end if;
	elsif chapter=4 then
		if schalice=1 or schalice=2 or (scene=1 and chaliceheld) then
			near_success:=true;
		end if;
	end if;







		glUseProgram(pidskyb01);
		glUniform1i(flevid01, extfoglev);
		glUniform1i(fcolid01, extfogclr);
		glUniform1i(mapid01, 0);
		glUniformMatrix4fv(mvpid01, 1, GL_FALSE, mmvp(1,1)'address);
		glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS);

		if chapter=1 or chapter=3 then
			if near_success then
				glBindTexture(GL_TEXTURE_CUBE_MAP, sunnycubemap_texid);
			else
				glBindTexture(GL_TEXTURE_CUBE_MAP, darkcubemap_texid);
			end if;
		else
			if near_success then
				glBindTexture(GL_TEXTURE_CUBE_MAP, mooncubemap_texid);
			else
				glBindTexture(GL_TEXTURE_CUBE_MAP, cloudycubemap_texid);
			end if;
		end if;

		cubemapobj.Draw(skybox, vertbuff,elembuff);


	if near_success then --draw jupiter
		glUniform1i(darkid02, 0);
		glUniform1i(flevid02, 0);
		glUniform1i(fcolid02, 0);
		glUniformMatrix4fv(mvpid02, 1, GL_FALSE, satmvp(1,1)'address);
		--glUniformMatrix4fv(mvidp, 1, GL_FALSE, satmv(1,1)'address);
		glBindTexture(GL_TEXTURE_2D, jup_texid);
		ellobj.draw(jupit,vertbuff,uvbuff,elembuff); --EquiRect
	end if;

