Skip to content

Commit

Permalink
some improvements to grunge maps
Browse files Browse the repository at this point in the history
and normal warping in grunge section added
angle correction algorithm added
  • Loading branch information
kmkolasinski committed May 11, 2015
1 parent beb00b7 commit 55b7d6f
Show file tree
Hide file tree
Showing 10 changed files with 612 additions and 201 deletions.
189 changes: 158 additions & 31 deletions Bin/Configs/41_Default.ini

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions Sources/CommonObjects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ SourceImageType FBOImageProporties::seamlessContrastInputType = INPUT_FROM_HEIGH
bool FBOImageProporties::bSeamlessTranslationsFirst = true;
int FBOImageProporties::seamlessMirroModeType = 0;
bool FBOImageProporties::bConversionBaseMap = false;

bool FBOImageProporties::bConversionBaseMapShowHeightTexture = false;
float FBOImageProporties::grungeOverallWeight = 0.0; // general weight for all images
float FBOImageProporties::grungeRadius = 25.0; // general weight for all images
bool FBOImageProporties::bGrungeEnableRandomTranslations = false; //
bool FBOImageProporties::bGrungeReplotAllWhenChanged = true;
bool FBOImageProporties::bGrungeEnableRandomTranslations = false; //
bool FBOImageProporties::bGrungeReplotAllWhenChanged = false;
int FBOImageProporties::grungeSeed = 0; // grunge randomization seed (if = 0 no randomization)
float FBOImageProporties::grungeNormalWarp = 0.0;

map<QString,int> FBOImageProporties::materialIndices;
int FBOImageProporties::currentMaterialIndeks = MATERIALS_DISABLED;
Expand Down
8 changes: 7 additions & 1 deletion Sources/CommonObjects.h
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,9 @@ class FBOImageProporties{
int conversionNHItersVerySmall;
// Base to others settings
static bool bConversionBaseMap;
static bool bConversionBaseMapShowHeightTexture;
float baseMapAngleCorrection;
float baseMapAngleWeight;
BaseMapConvLevelProperties baseMapConvLevels[4];

// ambient occlusion settings
Expand Down Expand Up @@ -517,9 +520,10 @@ class FBOImageProporties{
static int grungeSeed; // grunge randomization seed (if = 0 no randomization)
static float grungeRadius; // random radius
static bool bGrungeReplotAllWhenChanged;
static bool bGrungeEnableRandomTranslations;
static float grungeNormalWarp; // warp grunge image according to normal texture
float grungeImageWeight; // per image additional weight
float grungeMainImageWeight; // used for normal blending only
static bool bGrungeEnableRandomTranslations;
unsigned int grungeBlendingMode;
// global settings seamless parameters

Expand Down Expand Up @@ -586,6 +590,8 @@ class FBOImageProporties{
conversionNHItersVerySmall = 10;

bConversionBaseMap = false;
baseMapAngleCorrection = 0.0;
baseMapAngleWeight = 0.0;


ssaoNoIters = 4;
Expand Down
19 changes: 17 additions & 2 deletions Sources/formimageprop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ FormImageProp::FormImageProp(QMainWindow *parent, QGLWidget* qlW_ptr) :

// base map convertion
connect(ui->checkBoxEnableBaseMapToOthers ,SIGNAL(clicked()),this,SLOT(updateGuiCheckBoxes()));
connect(ui->checkBoxEnableBaseMapHeightTexture ,SIGNAL(clicked()),this,SLOT(updateGuiCheckBoxes()));
connect(ui->horizontalSliderBaseToOthersAngleCorrection ,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
connect(ui->horizontalSliderBaseToOthersAngleWeight ,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));


connect(ui->pushButtonConvertToNormalAndHeight,SIGNAL(released()),this,SLOT(applyBaseConversionConversion()));
Expand Down Expand Up @@ -183,6 +186,8 @@ FormImageProp::FormImageProp(QMainWindow *parent, QGLWidget* qlW_ptr) :
connect(ui->horizontalSliderGrungeOverallWeight,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
connect(ui->horizontalSliderGrungeSeed,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
connect(ui->horizontalSliderGrungeRadius,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
connect(ui->horizontalSliderGrungeNormalWarp,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));

connect(ui->checkBoxGrungeRandomTranslations,SIGNAL(clicked()),this,SLOT(updateGuiCheckBoxes()));
connect(ui->checkBoxGrungeReplotAllAfterChange,SIGNAL(clicked()),this,SLOT(updateGuiCheckBoxes()));

Expand Down Expand Up @@ -492,6 +497,8 @@ void FormImageProp::updateGuiSpinBoxesAndLabes(int){
baseMapConvLevels[i]->getSlidersValues(imageProp.baseMapConvLevels[i]);
}
}
imageProp.baseMapAngleCorrection = ui->horizontalSliderBaseToOthersAngleCorrection->value();
imageProp.baseMapAngleWeight = ui->horizontalSliderBaseToOthersAngleWeight->value();


imageProp.ssaoNoIters = ui->horizontalSliderSSAONoIters->value();
Expand Down Expand Up @@ -548,6 +555,7 @@ void FormImageProp::updateGuiSpinBoxesAndLabes(int){
imageProp.grungeOverallWeight = ui->horizontalSliderGrungeOverallWeight->value();
imageProp.grungeSeed = ui->horizontalSliderGrungeSeed->value();
imageProp.grungeRadius = ui->horizontalSliderGrungeRadius->value();
imageProp.grungeNormalWarp = ui->horizontalSliderGrungeNormalWarp->value();
}
imageProp.grungeImageWeight = ui->horizontalSliderGrungeImageWeight->value();
imageProp.grungeMainImageWeight = ui->horizontalSliderGrungeMainImageWeight->value();
Expand Down Expand Up @@ -588,6 +596,7 @@ void FormImageProp::updateGuiCheckBoxes(){


imageProp.bConversionBaseMap = ui->checkBoxEnableBaseMapToOthers->isChecked();
imageProp.bConversionBaseMapShowHeightTexture = ui->checkBoxEnableBaseMapHeightTexture->isChecked();

imageProp.bSelectiveBlurPreviewMask = ui->pushButtonSelectiveBlurPreviewMask->isChecked();
imageProp.bSelectiveBlurInvertMask = ui->checkBoxSelectiveBlurInvertMask ->isChecked();
Expand Down Expand Up @@ -821,8 +830,8 @@ void FormImageProp::reloadSettings(){

//ui->checkBoxEnableHeightToNormal ->setChecked(imageProp.bConversionHN);
//ui->checkBoxEnableNormalToHeight ->setChecked(imageProp.bConversionNH);
//ui->checkBoxEnableBaseMapToOthers ->setChecked(imageProp.bConversionBaseMap);

//
ui->checkBoxEnableBaseMapHeightTexture ->setChecked(imageProp.bConversionBaseMapShowHeightTexture);
ui->horizontalSliderRemoveShadingGaussIter->setValue(imageProp.noRemoveShadingGaussIter);


Expand Down Expand Up @@ -867,6 +876,8 @@ void FormImageProp::reloadSettings(){
baseMapConvLevels[i]->updateSliders(imageProp.baseMapConvLevels[i]);
}
}
ui->horizontalSliderBaseToOthersAngleCorrection->setValue(imageProp.baseMapAngleCorrection);
ui->horizontalSliderBaseToOthersAngleWeight ->setValue(imageProp.baseMapAngleWeight);

ui->horizontalSliderSSAONoIters ->setValue(imageProp.ssaoNoIters);
ui->horizontalSliderSSAOBias ->setValue(imageProp.ssaoBias*100);
Expand Down Expand Up @@ -943,7 +954,11 @@ void FormImageProp::reloadSettings(){
//ui->horizontalSliderGrungeOverallWeight ->setValue(imageProp.grungeOverallWeight);
ui->horizontalSliderGrungeRadius ->setValue(imageProp.grungeRadius);
ui->horizontalSliderGrungeSeed ->setValue(imageProp.grungeSeed);
ui->horizontalSliderGrungeNormalWarp ->setValue(imageProp.grungeNormalWarp);

ui->checkBoxGrungeRandomTranslations->setChecked(imageProp.bGrungeEnableRandomTranslations);
ui->checkBoxGrungeReplotAllAfterChange->setChecked(imageProp.bGrungeReplotAllWhenChanged);

}


Expand Down
Loading

0 comments on commit 55b7d6f

Please sign in to comment.