Beispiel #1
0
void App::makeGUI() {
    // Initialize the developer HUD (using the existing scene)
    createDeveloperHUD();
    debugWindow->setVisible(true);
    developerWindow->videoRecordDialog->setEnabled(true);

    // More examples of debugging GUI controls:
    // debugPane->addCheckBox("Use explicit checking", &explicitCheck);
    // debugPane->addTextBox("Name", &myName);
    // debugPane->addNumberBox("height", &height, "m", GuiTheme::LINEAR_SLIDER, 1.0f, 2.5f);
    // button = debugPane->addButton("Run Simulator");
	debugPane->beginRow(); {
		debugPane->addCheckBox("Cone trace", &m_enableSVO);
		debugPane->addCheckBox("Fragments", &m_debugSVOFragments);
		debugPane->addCheckBox("Nodes", &m_debugSVONodes);
		debugPane->addNumberBox("Level", &m_debugSVONodeLevel, "", GuiTheme::LINEAR_SLIDER, 0, SVO_MAX_DEPTH, 1);
	} debugPane->endRow();

	debugPane->beginRow(); {

		GuiSlider<float> *slider1 = debugPane->addSlider("Cone aperture: ", &m_voxelConeAperture, 0.0f, 64.0f);
		slider1->setWidth(600);

	
	} debugPane->endRow();

    debugWindow->pack();
    debugWindow->setRect(Rect2D::xywh(0, 0, (float)window()->width(), debugWindow->rect().height()));
}
Beispiel #2
0
void App::makeGUI() {
    // Initialize the developer HUD (using the existing scene)
    createDeveloperHUD();
    debugWindow->setVisible(false);
    developerWindow->videoRecordDialog->setVisible(false);
    developerWindow->cameraControlWindow->setVisible(false);
    developerWindow->sceneEditorWindow->setVisible(false);
    developerWindow->setVisible(false);
    showRenderingStats = false;
    
    GuiPane* infoPane = debugPane->addPane("Info", GuiTheme::ORNATE_PANE_STYLE);
    infoPane->beginRow(); {
        infoPane->addButton("Pause", [this]() { m_automata.setPaused(!m_automata.paused()); });
        infoPane->addNumberBox("BPM", &m_automata.m_bpm, "", GuiTheme::LINEAR_SLIDER, 30, 300);
        infoPane->addEnumClassRadioButtons("Display Mode", &m_automata.m_displayMode);
    } infoPane->endRow();
    // Example of how to add debugging controls
    infoPane->pack();

    // More examples of debugging GUI controls:
    // debugPane->addCheckBox("Use explicit checking", &explicitCheck);
    // debugPane->addTextBox("Name", &myName);
    // debugPane->addNumberBox("height", &height, "m", GuiTheme::LINEAR_SLIDER, 1.0f, 2.5f);
    // button = debugPane->addButton("Run Simulator");

    debugWindow->pack();
    debugWindow->setRect(Rect2D::xywh(0, 0, (float)window()->width(), debugWindow->rect().height()));
}
Beispiel #3
0
void App::onInit() {
    setScene(Scene::create());
    logPrintf("App::onInit()\n");
    createDeveloperHUD();
    showRenderingStats = false;

    developerWindow->cameraControlWindow->setVisible(false);
    developerWindow->setVisible(false);
    developerWindow->videoRecordDialog->setCaptureGui(false);

    m_debugCamera->filmSettings().setAntialiasingEnabled(true);
    if (filename != "") {
        window()->setCaption(filenameBaseExt(filename) + " - G3D Viewer");
    }

    lighting = shared_ptr<LocalLightingEnvironment>(new LocalLightingEnvironment());
    lighting->lightArray.clear();
    // The spot light is designed to just barely fit the 3D models.  Note that it has no attenuation
    lighting->lightArray.append(Light::spotTarget("Light", Point3(20, 200, 20), Point3::zero(), 8 * units::degrees(), Power3(25.0f), 1, 0, 0, true, 8192));
    lighting->environmentMapArray.append(ScaledTexture(Texture::fromFile(System::findDataFile("uffizi/uffizi*.jpg"), ImageFormat::SRGB8(), Texture::DIM_CUBE_MAP, Texture::Settings::cubeMap()), 0.65f));
    lighting->ambientOcclusionSettings.numSamples   = 24; // High-quality AO
    lighting->ambientOcclusionSettings.radius       = 1.6f * units::meters();
    lighting->ambientOcclusionSettings.intensity    = 1.0f;
    lighting->ambientOcclusionSettings.bias         = 0.002f * units::meters();
    m_debugCamera->setFarPlaneZ(-1000);
    m_debugCamera->setNearPlaneZ(-0.05f);

    // Don't clip to the near plane
    glDisable(GL_DEPTH_CLAMP);	
    colorClear = Color3::white() * 0.9f;
    //modelController = ThirdPersonManipulator::create();

    setViewer(filename);
    logPrintf("Done App::onInit()\n");
}
Beispiel #4
0
void App::makeGUI() {
    // Initialize the developer HUD
    createDeveloperHUD();
    debugWindow->setVisible(false);
    developerWindow->videoRecordDialog->setEnabled(true);

    debugWindow->pack();
    debugWindow->setRect(Rect2D::xywh(0, 0, (float)window()->width(), debugWindow->rect().height()));
}
Beispiel #5
0
void App::onInit() {
    GApp::onInit();


	renderDevice->setSwapBuffersAutomatically(true);
    logPrintf("App::onInit()\n");
    createDeveloperHUD();
    showRenderingStats = false;

    developerWindow->cameraControlWindow->setVisible(false);
    developerWindow->setVisible(false);
    developerWindow->videoRecordDialog->setCaptureGui(false);

    m_debugCamera->filmSettings().setBloomStrength(0.20f);
    m_debugCamera->filmSettings().setBloomRadiusFraction(0.017f);
    m_debugCamera->filmSettings().setAntialiasingEnabled(true);
    m_debugCamera->filmSettings().setCelluloidToneCurve();

    if (! filename.empty()) {
        window()->setCaption(filenameBaseExt(filename) + " - G3D Viewer");
    }

    lighting = shared_ptr<LightingEnvironment>(new LightingEnvironment());
    lighting->lightArray.clear();
    // The spot light is designed to just barely fit the 3D models.  Note that it has no attenuation
    lighting->lightArray.append(Light::spotTarget("Light", Point3(40, 120, 80), Point3::zero(), 10 * units::degrees(), Power3(50.0f), 1, 0, 0, true, 8192));
    lighting->lightArray.last()->shadowMap()->setBias(0.1f);

    Texture::Encoding e;
    e.readMultiplyFirst = Color4(Color3(0.5f));
    e.format = ImageFormat::RGB32F();

    lighting->environmentMapArray.append(Texture::fromFile(System::findDataFile("uffizi/uffizi-*.exr"), e, Texture::DIM_CUBE_MAP));
    lighting->ambientOcclusionSettings.numSamples   = 24;
    lighting->ambientOcclusionSettings.radius       = 0.75f * units::meters();
    lighting->ambientOcclusionSettings.intensity    = 2.0f;
    lighting->ambientOcclusionSettings.bias         = 0.06f * units::meters();
    lighting->ambientOcclusionSettings.useDepthPeelBuffer = true;

    m_debugCamera->setFarPlaneZ(-finf());
    m_debugCamera->setNearPlaneZ(-0.05f);

    // Don't clip to the near plane
    glDisable(GL_DEPTH_CLAMP);	
    colorClear = Color3::white() * 0.9f;

    //modelController = ThirdPersonManipulator::create();
    m_gbufferSpecification.encoding[GBuffer::Field::CS_POSITION_CHANGE].format = NULL;
    gbuffer()->setSpecification(m_gbufferSpecification);

    setViewer(filename);
    developerWindow->sceneEditorWindow->setVisible(false);
    logPrintf("Done App::onInit()\n");
}
Beispiel #6
0
void App::onInit() {
    ArticulatedModel::Specification spec;
    spec.filename       = System::findDataFile("teapot/teapot.obj");
    spec.stripMaterials = true;
    spec.scale          = 0.035f;

    shared_ptr<ArticulatedModel> model = ArticulatedModel::create(spec);
    model->pose(m_sceneGeometry, Point3(0, -1.7f, 0));

    createDeveloperHUD();
}
Beispiel #7
0
void App::makeGUI() {
    createDeveloperHUD();

    debugWindow->setVisible(false);
    developerWindow->videoRecordDialog->setEnabled(true);
    developerWindow->sceneEditorWindow->setVisible(false);
    developerWindow->cameraControlWindow->setVisible(false);

    debugWindow->pack();
    debugWindow->setRect(Rect2D::xywh(0, 0, (float)window()->width(), debugWindow->rect().height()));
}
Beispiel #8
0
    void onInit() override {
        renderDevice->setColorClearValue(Color3::white());
        m_name = NetAddress::localHostname();
        window()->setCaption(m_name + " (" + NetAddress(m_name, 0).ipString() + ":" + format("%d", PORT) + ")");

        m_server = NetServer::create(NetAddress(NetAddress::DEFAULT_ADAPTER_HOST, PORT));
        createDeveloperHUD();
        developerWindow->setVisible(false);
        developerWindow->cameraControlWindow->setVisible(false);
        makeGUI();
        showRenderingStats = false;
        debugWindow->setVisible(true);
    }
Beispiel #9
0
void App::makeGUI() {
    // Initialize the developer HUD (using the existing scene)
    createDeveloperHUD();
    debugWindow->setVisible(false);
    developerWindow->videoRecordDialog->setEnabled(true);
    developerWindow->cameraControlWindow->setVisible(false);

    if (false) {
        developerWindow->profilerWindow->setVisible(true);
        Profiler::setEnabled(true);
    }

    debugWindow->pack();
    debugWindow->setRect(Rect2D::xywh(0, 0, (float)window()->width(), debugWindow->rect().height()));
}
Beispiel #10
0
void App::makeGUI() {
    createDeveloperHUD();

    debugWindow->setVisible(true);
    developerWindow->setVisible(false);
    developerWindow->cameraControlWindow->setVisible(false);
    showRenderingStats = false;

    // Show the G-buffers
    debugPane->setCaption(GuiText("GBuffer", GFont::fromFile(System::findDataFile("arial.fnt")), 16));
    debugPane->moveBy(2, 10);

    GuiTabPane* tabPane = dynamic_cast<GuiTabPane*>(GUI::makeGBufferPane(m_gbuffer, debugPane));
    tabPane->setWidth(800);
    debugPane->pack();
}
Beispiel #11
0
void App::makeGUI() {
    // Initialize the developer HUD (using the existing scene)
    createDeveloperHUD();
    debugWindow->setVisible(false);
    developerWindow->videoRecordDialog->setEnabled(true);
    debugPane->pack();


    debugWindow->pack();
    debugWindow->setRect(Rect2D::xywh(0, 0, (float)window()->width(), debugWindow->rect().height()));
    developerWindow->cameraControlWindow->setVisible(false);
    developerWindow->sceneEditorWindow->setVisible(false);
    developerWindow->setVisible(false);
    showRenderingStats = false;
    developerWindow->cameraControlWindow->moveTo(Point2(developerWindow->cameraControlWindow->rect().x0(), 0));


}
Beispiel #12
0
void App::onInit() {
	tick();

    message("Loading...");
	renderDevice->setSwapBuffersAutomatically(true);

	m_world = new World(m_worldScene);

    // Create one random number generator per thread
    m_rng.resize(GThread::numCores());
    for (int i = 0; i < m_rng.size(); ++i) {
        //m_rng[i].reset(0xF018A4D2 ^ i, false);
		//m_rng[i].reset(uint32(System::time()) ^ i);
    }
	Array<Plane,10> clipPlanes;
	float a,b,c,d;

    showRenderingStats = false;
    createDeveloperHUD();
    developerWindow->setVisible(false);
    developerWindow->cameraControlWindow->setVisible(false);
    m_debugCamera->filmSettings().setAntialiasingEnabled(false);
	m_debugCamera->filmSettings().setAntialiasingHighQuality(false);
	m_debugCamera->filmSettings().setBloomStrength(0.0f);
	m_debugCamera->setFrame(m_world->frame);
	m_debugCamera->setFieldOfView(m_world->FOVDeg*pi()/180.0,FOVDirection::VERTICAL);
	m_debugCamera->getClipPlanes(Rect2D(Vector2(window()->width(),window()->height())),clipPlanes);

	clipPlanes[0].getEquation(a,b,c,d);
	m_focalPlane = Plane::fromEquation(-a,-b,-c,-(d-(m_world->focalDist)));	
	
    makeGUI();
    // Force re-render on first frame
    m_prevCFrame = CFrame(Matrix3::zero());
	float time = tock("Loading scene");

	//Initialize StatsData class 
	m_featureData.init(m_imgWidth,m_imgHeight,m_sampleBudget,m_samplesPerIteration);
	//Initialize filter with the features data pointers;
	m_CBFilter.init(&m_featureData);
}
Beispiel #13
0
void App::onInit() {
    message("Loading...");
	
    m_world = new World();
	
    showRenderingStats = false;
    createDeveloperHUD();
    developerWindow->setVisible(false);
    developerWindow->cameraControlWindow->setVisible(false);
    m_debugCamera->filmSettings().setAntialiasingEnabled(true);
    m_debugCamera->filmSettings().setContrastToneCurve();

    // Starting position
    m_debugCamera->setFrame(CFrame::fromXYZYPRDegrees(24.3f, 0.4f, 2.5f, 68.7f, 1.2f, 0.0f));
    m_debugCamera->frame();

    makeGUI();

    // Force re-render on first frame
    m_prevCFrame = CFrame(Matrix3::zero());
}
Beispiel #14
0
void App::onInit() {
    GApp::onInit();
    createDeveloperHUD();
	renderDevice->setSwapBuffersAutomatically(true);

    window()->setCaption("Pixel Shader Demo");
        
    ArticulatedModel::Specification spec;
    spec.filename = System::findDataFile("teapot/teapot.obj");
    spec.scale = 0.015f;
    spec.stripMaterials = true;
    spec.preprocess.append(ArticulatedModel::Instruction(Any::parse("setCFrame(root(), Point3(0, -0.5, 0));")));
    model = ArticulatedModel::create(spec);

    makeLighting();
    makeColorList();
    makeGui();

    // Color 1 is red
    lambertianColorIndex = 1;
    // The last color is white
    glossyColorIndex = colorList.size() - 1;
    
    m_debugCamera->setPosition(Vector3(1.0f, 1.0f, 2.5f));
    m_debugCamera->setFieldOfView(45 * units::degrees(), FOVDirection::VERTICAL);
    m_debugCamera->lookAt(Point3::zero());

    // Add axes for dragging and turning the model
    manipulator = ThirdPersonManipulator::create();
    addWidget(manipulator);

    // Turn off the default first-person camera controller and developer UI
    m_debugController->setEnabled(false);
    developerWindow->setVisible(false);
    developerWindow->cameraControlWindow->setVisible(false);
    showRenderingStats = false;
}
Beispiel #15
0
void App::makeGUI() {
    // Initialize the developer HUD (using the existing scene)
    createDeveloperHUD();
    debugWindow->setVisible(true);
    developerWindow->videoRecordDialog->setEnabled(true);

    GuiPane* infoPane = debugPane->addPane("Info", GuiTheme::ORNATE_PANE_STYLE);
    infoPane->addCheckBox("Show wireframe", &m_showWireframe);

    // Example of how to add debugging controls
    infoPane->addLabel("You can add more GUI controls");
    infoPane->addLabel("in App::onInit().");
    infoPane->addButton("Exit", this, &App::endProgram);
    infoPane->pack();

    // More examples of debugging GUI controls:
    // debugPane->addCheckBox("Use explicit checking", &explicitCheck);
    // debugPane->addTextBox("Name", &myName);
    // debugPane->addNumberBox("height", &height, "m", GuiTheme::LINEAR_SLIDER, 1.0f, 2.5f);
    // button = debugPane->addButton("Run Simulator");

    debugWindow->pack();
    debugWindow->setRect(Rect2D::xywh(0, 0, (float)window()->width(), debugWindow->rect().height()));
}
Beispiel #16
0
void App::onInit() {
    createDeveloperHUD();
	renderDevice->setSwapBuffersAutomatically(true);
    renderDevice->setColorClearValue(Color3::white());
    debugWindow->setVisible(false);
    developerWindow->cameraControlWindow->setVisible(true);
    developerWindow->cameraControlWindow->moveTo(Vector2(developerWindow->cameraControlWindow->rect().x0(), 0));
    developerWindow->setVisible(false);
    showRenderingStats = false;
    
    m_debugCamera->setFrame(CFrame::fromXYZYPRDegrees(-0.61369f, 0.734589f, 0.934322f, 314.163f, -12.1352f));
    m_debugCamera->filmSettings().setVignetteBottomStrength(0);
    m_debugCamera->filmSettings().setVignetteTopStrength(0);

    m_scene = BuildingScene::create();

    m_debugCamera->filmSettings().setAntialiasingEnabled(false);
    
    shared_ptr<GuiTheme> theme = debugWindow->theme();

    // Example of how to create windows
    shared_ptr<GuiWindow> toolBar = GuiWindow::create("Tools", theme, Rect2D::xywh(0,0,0,0), GuiTheme::TOOL_WINDOW_STYLE);

    shared_ptr<IconSet> icons = IconSet::fromFile(System::findDataFile("tango.icn"));
    GuiPane* toolPane = toolBar->pane();

    toolPane->addButton(icons->get("22x22/uwe/CreateCylinder.png"), GuiTheme::TOOL_BUTTON_STYLE);
    toolPane->addButton(icons->get("22x22/uwe/CreateBox.png"), GuiTheme::TOOL_BUTTON_STYLE);
    toolPane->addButton(icons->get("22x22/uwe/Emitter.png"), GuiTheme::TOOL_BUTTON_STYLE);
    toolPane->addButton(icons->get("22x22/uwe/PointLight.png"), GuiTheme::TOOL_BUTTON_STYLE)->moveBy(Vector2(10,0));
    toolPane->addButton(icons->get("22x22/categories/applications-multimedia.png"), GuiTheme::TOOL_BUTTON_STYLE);
    toolPane->addButton(icons->get("22x22/categories/applications-graphics.png"), GuiTheme::TOOL_BUTTON_STYLE);
    toolPane->addButton(icons->get("22x22/categories/applications-system.png"), GuiTheme::TOOL_BUTTON_STYLE);
    toolBar->pack();
    addWidget(toolBar);
}