updated editor

This commit is contained in:
turanszkij
2016-12-01 22:29:27 +01:00
parent 5cf38c2c68
commit 48605d49d3
4 changed files with 65 additions and 9 deletions
+44 -9
View File
@@ -343,7 +343,7 @@ void EditorComponent::Load()
wiCheckBox* translatorCheckBox = new wiCheckBox("Translator: ");
translatorCheckBox->SetTooltip("Enable the translator tool");
translatorCheckBox->SetPos(XMFLOAT2(screenW - 50 - 105 * 5 - 25, 0));
translatorCheckBox->SetPos(XMFLOAT2(screenW - 50 - 105 * 6 - 25, 0));
translatorCheckBox->SetSize(XMFLOAT2(18, 18));
translatorCheckBox->OnClick([=](wiEventArgs args) {
if(!args.bValue)
@@ -354,7 +354,7 @@ void EditorComponent::Load()
wiCheckBox* isScalatorCheckBox = new wiCheckBox("S:");
isScalatorCheckBox->SetTooltip("Scale");
isScalatorCheckBox->SetPos(XMFLOAT2(screenW - 50 - 105 * 5 - 25 - 40 * 2, 22));
isScalatorCheckBox->SetPos(XMFLOAT2(screenW - 50 - 105 * 6 - 25 - 40 * 2, 22));
isScalatorCheckBox->SetSize(XMFLOAT2(18, 18));
isScalatorCheckBox->OnClick([=](wiEventArgs args) {
translator->isScalator = args.bValue;
@@ -364,7 +364,7 @@ void EditorComponent::Load()
wiCheckBox* isRotatorCheckBox = new wiCheckBox("R:");
isRotatorCheckBox->SetTooltip("Rotate");
isRotatorCheckBox->SetPos(XMFLOAT2(screenW - 50 - 105 * 5 - 25 - 40 * 1, 22));
isRotatorCheckBox->SetPos(XMFLOAT2(screenW - 50 - 105 * 6 - 25 - 40 * 1, 22));
isRotatorCheckBox->SetSize(XMFLOAT2(18, 18));
isRotatorCheckBox->OnClick([=](wiEventArgs args) {
translator->isRotator = args.bValue;
@@ -374,7 +374,7 @@ void EditorComponent::Load()
wiCheckBox* isTranslatorCheckBox = new wiCheckBox("T:");
isTranslatorCheckBox->SetTooltip("Translate");
isTranslatorCheckBox->SetPos(XMFLOAT2(screenW - 50 - 105 * 5 - 25, 22));
isTranslatorCheckBox->SetPos(XMFLOAT2(screenW - 50 - 105 * 6 - 25, 22));
isTranslatorCheckBox->SetSize(XMFLOAT2(18, 18));
isTranslatorCheckBox->OnClick([=](wiEventArgs args) {
translator->isTranslator = args.bValue;
@@ -385,7 +385,7 @@ void EditorComponent::Load()
wiButton* saveButton = new wiButton("Save");
saveButton->SetTooltip("Save the current scene as a model");
saveButton->SetPos(XMFLOAT2(screenW - 50 - 105 * 5, 0));
saveButton->SetPos(XMFLOAT2(screenW - 50 - 105 * 6, 0));
saveButton->SetSize(XMFLOAT2(100, 40));
saveButton->SetColor(wiColor(0, 198, 101, 200), wiWidget::WIDGETSTATE::IDLE);
saveButton->SetColor(wiColor(0, 255, 140, 255), wiWidget::WIDGETSTATE::FOCUS);
@@ -449,7 +449,7 @@ void EditorComponent::Load()
wiButton* modelButton = new wiButton("Load Model");
modelButton->SetTooltip("Load a model into the editor...");
modelButton->SetPos(XMFLOAT2(screenW - 50 - 105 * 4, 0));
modelButton->SetPos(XMFLOAT2(screenW - 50 - 105 * 5, 0));
modelButton->SetSize(XMFLOAT2(100, 40));
modelButton->SetColor(wiColor(0, 89, 255, 200), wiWidget::WIDGETSTATE::IDLE);
modelButton->SetColor(wiColor(112, 155, 255, 255), wiWidget::WIDGETSTATE::FOCUS);
@@ -503,7 +503,7 @@ void EditorComponent::Load()
wiButton* skyButton = new wiButton("Load Sky");
skyButton->SetTooltip("Load a skybox cubemap texture...");
skyButton->SetPos(XMFLOAT2(screenW - 50 - 105 * 3, 0));
skyButton->SetPos(XMFLOAT2(screenW - 50 - 105 * 4, 0));
skyButton->SetSize(XMFLOAT2(100, 18));
skyButton->SetColor(wiColor(0, 89, 255, 200), wiWidget::WIDGETSTATE::IDLE);
skyButton->SetColor(wiColor(112, 155, 255, 255), wiWidget::WIDGETSTATE::FOCUS);
@@ -547,7 +547,7 @@ void EditorComponent::Load()
wiButton* colorGradingButton = new wiButton("Color Grading");
colorGradingButton->SetTooltip("Load a color grading lookup texture...");
colorGradingButton->SetPos(XMFLOAT2(screenW - 50 - 105 * 3, 22));
colorGradingButton->SetPos(XMFLOAT2(screenW - 50 - 105 * 4, 22));
colorGradingButton->SetSize(XMFLOAT2(100, 18));
colorGradingButton->SetColor(wiColor(0, 89, 255, 200), wiWidget::WIDGETSTATE::IDLE);
colorGradingButton->SetColor(wiColor(112, 155, 255, 255), wiWidget::WIDGETSTATE::FOCUS);
@@ -591,7 +591,7 @@ void EditorComponent::Load()
wiButton* scriptButton = new wiButton("Load Script");
scriptButton->SetTooltip("Load a Lua script...");
scriptButton->SetPos(XMFLOAT2(screenW - 50 - 105 * 2, 0));
scriptButton->SetPos(XMFLOAT2(screenW - 50 - 105 * 3, 0));
scriptButton->SetSize(XMFLOAT2(100, 40));
scriptButton->SetColor(wiColor(255, 33, 140, 200), wiWidget::WIDGETSTATE::IDLE);
scriptButton->SetColor(wiColor(255, 100, 140, 255), wiWidget::WIDGETSTATE::FOCUS);
@@ -624,6 +624,41 @@ void EditorComponent::Load()
GetGUI().AddWidget(scriptButton);
wiButton* shaderButton = new wiButton("Load Shaders");
shaderButton->SetTooltip("Load shaders from the specified directory...");
shaderButton->SetPos(XMFLOAT2(screenW - 50 - 105 * 2, 0));
shaderButton->SetSize(XMFLOAT2(100, 40));
shaderButton->SetColor(wiColor(255, 33, 140, 200), wiWidget::WIDGETSTATE::IDLE);
shaderButton->SetColor(wiColor(255, 100, 140, 255), wiWidget::WIDGETSTATE::FOCUS);
shaderButton->OnClick([=](wiEventArgs args) {
thread([&] {
char szFile[260];
OPENFILENAMEA ofn;
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = nullptr;
ofn.lpstrFile = szFile;
// Set lpstrFile[0] to '\0' so that GetOpenFileName does not
// use the contents of szFile to initialize itself.
ofn.lpstrFile[0] = '\0';
ofn.nMaxFile = sizeof(szFile);
ofn.lpstrFilter = "Compiled shader object file\0*.cso\0";
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
if (GetOpenFileNameA(&ofn) == TRUE) {
string fileName = ofn.lpstrFile;
wiRenderer::ReloadShaders(wiHelper::GetDirectoryFromPath(fileName));
}
}).detach();
});
GetGUI().AddWidget(shaderButton);
wiButton* clearButton = new wiButton("Clear World");
clearButton->SetTooltip("Delete every model from the scene");
clearButton->SetPos(XMFLOAT2(screenW - 50 - 105 * 1, 0));
+6
View File
@@ -19,6 +19,7 @@ MeshWindow::MeshWindow(wiGUI* gui) : GUI(gui)
float y = 0;
doubleSidedCheckBox = new wiCheckBox("Double Sided: ");
doubleSidedCheckBox->SetTooltip("If enabled, the inside of the mesh will be visible.");
doubleSidedCheckBox->SetPos(XMFLOAT2(x, y += 30));
doubleSidedCheckBox->OnClick([&](wiEventArgs args) {
if (mesh != nullptr)
@@ -29,6 +30,7 @@ MeshWindow::MeshWindow(wiGUI* gui) : GUI(gui)
meshWindow->AddWidget(doubleSidedCheckBox);
massSlider = new wiSlider(0, 5000, 0, 100000, "Mass: ");
massSlider->SetTooltip("Set the mass amount for the physics engine.");
massSlider->SetSize(XMFLOAT2(100, 30));
massSlider->SetPos(XMFLOAT2(x, y += 30));
massSlider->OnSlide([&](wiEventArgs args) {
@@ -40,6 +42,7 @@ MeshWindow::MeshWindow(wiGUI* gui) : GUI(gui)
meshWindow->AddWidget(massSlider);
frictionSlider = new wiSlider(0, 5000, 0, 100000, "Friction: ");
frictionSlider->SetTooltip("Set the friction amount for the physics engine.");
frictionSlider->SetSize(XMFLOAT2(100, 30));
frictionSlider->SetPos(XMFLOAT2(x, y += 30));
frictionSlider->OnSlide([&](wiEventArgs args) {
@@ -51,6 +54,7 @@ MeshWindow::MeshWindow(wiGUI* gui) : GUI(gui)
meshWindow->AddWidget(frictionSlider);
impostorCreateButton = new wiButton("Create Impostor");
impostorCreateButton->SetTooltip("Create an impostor image of the mesh. The mesh will be replaced by this image when far away, to render faster.");
impostorCreateButton->SetSize(XMFLOAT2(240, 30));
impostorCreateButton->SetPos(XMFLOAT2(x - 50, y += 30));
impostorCreateButton->OnClick([&](wiEventArgs args) {
@@ -62,6 +66,7 @@ MeshWindow::MeshWindow(wiGUI* gui) : GUI(gui)
meshWindow->AddWidget(impostorCreateButton);
impostorDistanceSlider = new wiSlider(0, 1000, 100, 10000, "Impostor Distance: ");
impostorDistanceSlider->SetTooltip("Assign the distance where the mesh geometry should be switched to the impostor image.");
impostorDistanceSlider->SetSize(XMFLOAT2(100, 30));
impostorDistanceSlider->SetPos(XMFLOAT2(x, y += 30));
impostorDistanceSlider->OnSlide([&](wiEventArgs args) {
@@ -73,6 +78,7 @@ MeshWindow::MeshWindow(wiGUI* gui) : GUI(gui)
meshWindow->AddWidget(impostorDistanceSlider);
tessellationFactorSlider = new wiSlider(0, 16, 0, 10000, "Tessellation Factor: ");
tessellationFactorSlider->SetTooltip("Set the dynamic tessellation amount. Tessellation should be enabled in the Renderer window and your GPU must support it!");
tessellationFactorSlider->SetSize(XMFLOAT2(100, 30));
tessellationFactorSlider->SetPos(XMFLOAT2(x, y += 30));
tessellationFactorSlider->OnSlide([&](wiEventArgs args) {
+1
View File
@@ -18,6 +18,7 @@ ObjectWindow::ObjectWindow(wiGUI* gui) : GUI(gui)
GUI->AddWidget(objectWindow);
ditherSlider = new wiSlider(0, 1, 0, 1000, "Dither: ");
ditherSlider->SetTooltip("Adjust dithered transparency of the object.");
ditherSlider->SetSize(XMFLOAT2(100, 30));
ditherSlider->SetPos(XMFLOAT2(400, 30));
ditherSlider->OnSlide([&](wiEventArgs args) {
+14
View File
@@ -21,6 +21,7 @@ PostprocessWindow::PostprocessWindow(Renderable3DComponent* comp) : component(co
float y = 0;
lensFlareCheckBox = new wiCheckBox("LensFlare: ");
lensFlareCheckBox->SetTooltip("Toggle visibility of light source flares. Additional setup needed per light for a lensflare to be visible.");
lensFlareCheckBox->SetPos(XMFLOAT2(x, y += 35));
lensFlareCheckBox->SetCheck(component->getLensFlareEnabled());
lensFlareCheckBox->OnClick([&](wiEventArgs args) {
@@ -29,6 +30,7 @@ PostprocessWindow::PostprocessWindow(Renderable3DComponent* comp) : component(co
ppWindow->AddWidget(lensFlareCheckBox);
lightShaftsCheckBox = new wiCheckBox("LightShafts: ");
lightShaftsCheckBox->SetTooltip("Enable light shaft for directional light sources.");
lightShaftsCheckBox->SetPos(XMFLOAT2(x, y += 35));
lightShaftsCheckBox->SetCheck(component->getLightShaftsEnabled());
lightShaftsCheckBox->OnClick([&](wiEventArgs args) {
@@ -37,6 +39,7 @@ PostprocessWindow::PostprocessWindow(Renderable3DComponent* comp) : component(co
ppWindow->AddWidget(lightShaftsCheckBox);
ssaoCheckBox = new wiCheckBox("SSAO: ");
ssaoCheckBox->SetTooltip("Enable Screen Space Ambient Occlusion.");
ssaoCheckBox->SetPos(XMFLOAT2(x, y += 35));
ssaoCheckBox->SetCheck(component->getSSAOEnabled());
ssaoCheckBox->OnClick([&](wiEventArgs args) {
@@ -45,6 +48,7 @@ PostprocessWindow::PostprocessWindow(Renderable3DComponent* comp) : component(co
ppWindow->AddWidget(ssaoCheckBox);
ssrCheckBox = new wiCheckBox("SSR: ");
ssrCheckBox->SetTooltip("Enable Screen Space Reflections");
ssrCheckBox->SetPos(XMFLOAT2(x, y += 35));
ssrCheckBox->SetCheck(component->getSSREnabled());
ssrCheckBox->OnClick([&](wiEventArgs args) {
@@ -53,6 +57,7 @@ PostprocessWindow::PostprocessWindow(Renderable3DComponent* comp) : component(co
ppWindow->AddWidget(ssrCheckBox);
sssCheckBox = new wiCheckBox("SSS: ");
sssCheckBox->SetTooltip("Enable Subsurface Scattering");
sssCheckBox->SetPos(XMFLOAT2(x, y += 35));
sssCheckBox->SetCheck(component->getSSSEnabled());
sssCheckBox->OnClick([&](wiEventArgs args) {
@@ -61,6 +66,7 @@ PostprocessWindow::PostprocessWindow(Renderable3DComponent* comp) : component(co
ppWindow->AddWidget(sssCheckBox);
eyeAdaptionCheckBox = new wiCheckBox("EyeAdaption: ");
eyeAdaptionCheckBox->SetTooltip("Enable eye adaption for the overall screen luminance");
eyeAdaptionCheckBox->SetPos(XMFLOAT2(x, y += 35));
eyeAdaptionCheckBox->SetCheck(component->getEyeAdaptionEnabled());
eyeAdaptionCheckBox->OnClick([&](wiEventArgs args) {
@@ -69,6 +75,7 @@ PostprocessWindow::PostprocessWindow(Renderable3DComponent* comp) : component(co
ppWindow->AddWidget(eyeAdaptionCheckBox);
motionBlurCheckBox = new wiCheckBox("MotionBlur: ");
motionBlurCheckBox->SetTooltip("Enable motion blur for camera movement and animated meshes.");
motionBlurCheckBox->SetPos(XMFLOAT2(x, y += 35));
motionBlurCheckBox->SetCheck(component->getMotionBlurEnabled());
motionBlurCheckBox->OnClick([&](wiEventArgs args) {
@@ -77,6 +84,7 @@ PostprocessWindow::PostprocessWindow(Renderable3DComponent* comp) : component(co
ppWindow->AddWidget(motionBlurCheckBox);
depthOfFieldCheckBox = new wiCheckBox("DepthOfField: ");
depthOfFieldCheckBox->SetTooltip("Enable Depth of field effect. Additional focus and strength setup required.");
depthOfFieldCheckBox->SetPos(XMFLOAT2(x, y += 35));
depthOfFieldCheckBox->SetCheck(component->getDepthOfFieldEnabled());
depthOfFieldCheckBox->OnClick([&](wiEventArgs args) {
@@ -85,6 +93,7 @@ PostprocessWindow::PostprocessWindow(Renderable3DComponent* comp) : component(co
ppWindow->AddWidget(depthOfFieldCheckBox);
depthOfFieldFocusSlider = new wiSlider(0.01f, 600, 100, 10000, "Focus: ");
depthOfFieldFocusSlider->SetTooltip("Set the focus distance from the camera. The picture will be sharper near the focus, and blurrier further from it.");
depthOfFieldFocusSlider->SetSize(XMFLOAT2(100, 20));
depthOfFieldFocusSlider->SetPos(XMFLOAT2(x + 100, y));
depthOfFieldFocusSlider->SetValue(component->getDepthOfFieldFocus());
@@ -94,6 +103,7 @@ PostprocessWindow::PostprocessWindow(Renderable3DComponent* comp) : component(co
ppWindow->AddWidget(depthOfFieldFocusSlider);
depthOfFieldStrengthSlider = new wiSlider(0.01f, 4, 100, 1000, "Strength: ");
depthOfFieldStrengthSlider->SetTooltip("Set depth of field blur strength.");
depthOfFieldStrengthSlider->SetSize(XMFLOAT2(100, 20));
depthOfFieldStrengthSlider->SetPos(XMFLOAT2(x + 100, y += 35));
depthOfFieldStrengthSlider->SetValue(component->getDepthOfFieldStrength());
@@ -103,6 +113,7 @@ PostprocessWindow::PostprocessWindow(Renderable3DComponent* comp) : component(co
ppWindow->AddWidget(depthOfFieldStrengthSlider);
bloomCheckBox = new wiCheckBox("Bloom: ");
bloomCheckBox->SetTooltip("Enable bloom. The effect adds color bleeding to the brightest parts of the scene.");
bloomCheckBox->SetPos(XMFLOAT2(x, y += 35));
bloomCheckBox->SetCheck(component->getBloomEnabled());
bloomCheckBox->OnClick([&](wiEventArgs args) {
@@ -111,6 +122,7 @@ PostprocessWindow::PostprocessWindow(Renderable3DComponent* comp) : component(co
ppWindow->AddWidget(bloomCheckBox);
fxaaCheckBox = new wiCheckBox("FXAA: ");
fxaaCheckBox->SetTooltip("Fast Approximate Anti Aliasing. A fast antialiasing method, but can be a bit too blurry.");
fxaaCheckBox->SetPos(XMFLOAT2(x, y += 35));
fxaaCheckBox->SetCheck(component->getFXAAEnabled());
fxaaCheckBox->OnClick([&](wiEventArgs args) {
@@ -119,6 +131,7 @@ PostprocessWindow::PostprocessWindow(Renderable3DComponent* comp) : component(co
ppWindow->AddWidget(fxaaCheckBox);
colorGradingCheckBox = new wiCheckBox("Color Grading: ");
colorGradingCheckBox->SetTooltip("Enable color grading of the final render. An additional lookup texture must be set for it to take effect.");
colorGradingCheckBox->SetPos(XMFLOAT2(x, y += 35));
colorGradingCheckBox->SetCheck(component->getColorGradingEnabled());
colorGradingCheckBox->OnClick([&](wiEventArgs args) {
@@ -127,6 +140,7 @@ PostprocessWindow::PostprocessWindow(Renderable3DComponent* comp) : component(co
ppWindow->AddWidget(colorGradingCheckBox);
stereogramCheckBox = new wiCheckBox("Stereogram: ");
stereogramCheckBox->SetTooltip("Compute a stereogram from the depth buffer. It produces a 3D sihouette image when viewed cross eyed.");
stereogramCheckBox->SetPos(XMFLOAT2(x, y += 35));
stereogramCheckBox->SetCheck(component->getStereogramEnabled());
stereogramCheckBox->OnClick([&](wiEventArgs args) {