#pragma once

#include "gui.h"
#include "framebuffer.h"
#include "tm.h"
#include "gfb.h"
#include "CGInterface.h"


class Scene {
public:

	CGInterface *cgi;
	ShaderOneInterface *soi;

	GUI *gui;
	FrameBuffer *fb, *fb3, *smfb, *hwfb, *gpufb;
	GFB *gfb;
	V3 L;
	float specc;
	TM *tms;
	int tmsN;
	FrameBuffer *texts;
	PPC *ppc, *ppc3, *smppc;
	Scene();
	void DBG();
	void NewButton();
	void Render(FrameBuffer *fb, PPC *ppc);
	void RenderRT(FrameBuffer *fb, PPC *ppc);
	void Intersect(V3 Vs[3], V3 O, V3 ray, V3 &abc, float &t);
	unsigned int TraceRay(int orderi, V3 O, V3 ray, V3 &rO, V3 &rray);
	void RenderAll();
	void ShadowMapSetup();
	void RenderHW();
	void RenderGPU();

	float morphFraction;
};

extern Scene *scene;