Skip to content

Commit

Permalink
Commit to 3.14 == Pi Version
Browse files Browse the repository at this point in the history
Some fixes and improevemnts:
1) Glossiness texture
2) Selecting camera position
...
  • Loading branch information
kmkolasinski committed Apr 21, 2015
1 parent 7731a13 commit b212a52
Show file tree
Hide file tree
Showing 37 changed files with 2,428 additions and 523 deletions.
62 changes: 52 additions & 10 deletions Bin/Configs/40_pistol.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ noPBRRays=2
noTessSubdivision=0
o_postfix=_o
r_postfix=_r
recent_dir=C:/Users/mkk/Downloads/Cerberus_by_Andrew_Maximov/Cerberus_by_Andrew_Maximov/Textures/my2
recent_mesh_dir=C:/Users/mkk/Downloads/Cerberus_by_Andrew_Maximov/Cerberus_by_Andrew_Maximov/untitled.obj
recent_dir=C:/Users/mkk/Downloads/Cerberus_by_Andrew_Maximov/Cerberus_by_Andrew_Maximov/Textures/Cerberus_A.jpg
recent_mesh_dir=E:/Doktorat/ZaawansowanaGrafika3D/AwesomeBumpRepo/AwesomeBump/Bin/Torus
s_postfix=_s
settings_description=...
settings_name=pistol
Expand Down Expand Up @@ -128,12 +128,12 @@ t_h_conversionBaseMapMixNormals=@Variant(\0\0\0\x87?\0\0\0)
t_h_conversionBaseMapNoIters=2
t_h_conversionBaseMapPreSmoothRadius=@Variant(\0\0\0\x87\0\0\0\0)
t_h_conversionHNDepth=@Variant(\0\0\0\x87\x41 \0\0)
t_h_conversionNHItersHuge=27
t_h_conversionNHItersLarge=13
t_h_conversionNHItersMedium=7
t_h_conversionNHItersSmall=6
t_h_conversionNHItersVeryLarge=19
t_h_conversionNHItersVerySmall=6
t_h_conversionNHItersHuge=46
t_h_conversionNHItersLarge=23
t_h_conversionNHItersMedium=15
t_h_conversionNHItersSmall=14
t_h_conversionNHItersVeryLarge=32
t_h_conversionNHItersVerySmall=15
t_h_detailDepth=@Variant(\0\0\0\x87?\x80\0\0)
t_h_grayScaleB=@Variant(\0\0\0\x87>\xa8\xa8\xa9)
t_h_grayScaleG=@Variant(\0\0\0\x87>\xa8\xa8\xa9)
Expand Down Expand Up @@ -306,7 +306,7 @@ t_n_inputImageType=3
t_n_mediumDetails=@Variant(\0\0\0\x87\0\0\0\0)
t_n_noBlurPasses=0
t_n_noRemoveShadingGaussIter=1
t_n_normalsStep=@Variant(\0\0\0\x87?\x80\0\0)
t_n_normalsStep=@Variant(\0\0\0\x87?\xb5\xc2\x8f)
t_n_pickedColorB=@Variant(\0\0\0\x87\0\0\0\0)
t_n_pickedColorG=@Variant(\0\0\0\x87\0\0\0\0)
t_n_pickedColorR=@Variant(\0\0\0\x87\0\0\0\0)
Expand Down Expand Up @@ -584,7 +584,7 @@ t_s_ssaoNoIters=20
tab_3d_settings_win_h=230
tab_3d_settings_win_w=772
tab_win_h=736
tab_win_w=354
tab_win_w=320
use_texture_interpolation=true
uv_contrast_input_image=0
uv_contrast_power=0
Expand Down Expand Up @@ -615,3 +615,45 @@ t_n_removeShadingLFRadius=@Variant(\0\0\0\x87\0\0\0\0)
t_o_removeShadingLFRadius=@Variant(\0\0\0\x87\0\0\0\0)
t_r_removeShadingLFRadius=@Variant(\0\0\0\x87\0\0\0\0)
t_s_removeShadingLFRadius=@Variant(\0\0\0\x87\0\0\0\0)
font_size=10
t_d_bHeightEnableNormalization=true
t_h_bHeightEnableNormalization=true
t_m_bHeightEnableNormalization=true
t_n_bHeightEnableNormalization=true
t_o_bHeightEnableNormalization=true
t_r_bHeightEnableNormalization=true
t_s_bHeightEnableNormalization=true
mouse_loop=true
t_d_conversionBaseMapAmplitude_Level0=@Variant(\0\0\0\x87\xbf\x80\0\0)
t_d_conversionBaseMapFlatness_Level0=@Variant(\0\0\0\x87\0\0\0\0)
t_d_conversionBaseMapNoIters_Level0=2
t_d_conversionBaseMapFilterRadius_Level0=0
t_d_conversionBaseMapMixNormals_Level0=@Variant(\0\0\0\x87?\0\0\0)
bDofEffect=true
t_d_conversionBaseMapPreSmoothRadius_Level0=@Variant(\0\0\0\x87\0\0\0\0)
t_d_conversionBaseMapBlending_Level0=@Variant(\0\0\0\x87?\0\0\0)
t_dconversionBaseMapWeight_Level0=@Variant(\0\0\0\x87\x42H\0\0)
t_d_conversionBaseMapAmplitude_Level1=@Variant(\0\0\0\x87\xbf\x80\0\0)
t_d_conversionBaseMapFlatness_Level1=@Variant(\0\0\0\x87\0\0\0\0)
t_d_conversionBaseMapNoIters_Level1=2
t_d_conversionBaseMapFilterRadius_Level1=0
t_d_conversionBaseMapMixNormals_Level1=@Variant(\0\0\0\x87?\0\0\0)
t_d_conversionBaseMapPreSmoothRadius_Level1=@Variant(\0\0\0\x87\0\0\0\0)
t_d_conversionBaseMapBlending_Level1=@Variant(\0\0\0\x87?\0\0\0)
t_dconversionBaseMapWeight_Level1=@Variant(\0\0\0\x87\x42H\0\0)
t_d_conversionBaseMapAmplitude_Level2=@Variant(\0\0\0\x87\xbf\x80\0\0)
t_d_conversionBaseMapFlatness_Level2=@Variant(\0\0\0\x87\0\0\0\0)
t_d_conversionBaseMapNoIters_Level2=2
t_d_conversionBaseMapFilterRadius_Level2=0
t_d_conversionBaseMapMixNormals_Level2=@Variant(\0\0\0\x87?\0\0\0)
t_d_conversionBaseMapPreSmoothRadius_Level2=@Variant(\0\0\0\x87\0\0\0\0)
t_d_conversionBaseMapBlending_Level2=@Variant(\0\0\0\x87?\0\0\0)
t_dconversionBaseMapWeight_Level2=@Variant(\0\0\0\x87\x42H\0\0)
t_d_conversionBaseMapAmplitude_Level3=@Variant(\0\0\0\x87\xbf\x80\0\0)
t_d_conversionBaseMapFlatness_Level3=@Variant(\0\0\0\x87\0\0\0\0)
t_d_conversionBaseMapNoIters_Level3=2
t_d_conversionBaseMapFilterRadius_Level3=0
t_d_conversionBaseMapMixNormals_Level3=@Variant(\0\0\0\x87?\0\0\0)
t_d_conversionBaseMapPreSmoothRadius_Level3=@Variant(\0\0\0\x87\0\0\0\0)
t_d_conversionBaseMapBlending_Level3=@Variant(\0\0\0\x87?\0\0\0)
t_dconversionBaseMapWeight_Level3=@Variant(\0\0\0\x87\x42H\0\0)
50 changes: 45 additions & 5 deletions Sources/CommonObjects.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#define AB_LOG_ALT "log.txt"
#endif

#define AWESOME_BUMP_VERSION "AwesomeBump v3.0.4 "
#define AWESOME_BUMP_VERSION "AwesomeBump Pi (2015)"

#define TEXTURE_FORMAT GL_RGB16F

Expand Down Expand Up @@ -286,13 +286,15 @@ class Performance3DSettings{
int noPBRRays;
bool bBloomEffect;
bool bDofEffect;
bool bShowTriangleEdges;
Performance3DSettings(){
bUseCullFace = false;
bUseSimplePBR = false;
noTessSubdivision = 16;
noPBRRays = 15;
bBloomEffect = true;
bDofEffect = true;
noTessSubdivision = 16;
noPBRRays = 15;
bBloomEffect = true;
bDofEffect = true;
bShowTriangleEdges = false;
}
};

Expand Down Expand Up @@ -380,6 +382,7 @@ class FBOImageProporties{
QGLFramebufferObject *fbo ; // output image

GLuint scr_tex_id; // Id of texture loaded from image, from loaded file
GLuint normalMixerInputTexId; // Used only by normal texture
int scr_tex_width; // width of the image loaded from file.
int scr_tex_height; // height ...
QGLWidget* glWidget_ptr; // pointer to GL context
Expand Down Expand Up @@ -481,6 +484,15 @@ class FBOImageProporties{
int selectiveBlurNoIters;
float roughnessColorGlobalOffset;

// normal map mixer
bool bNormalMixerEnabled;
bool bNormalMixerApplyNormals;
float normalMixerDepth;
float normalMixerScale;
float normalMixerAngle;
float normalMixerPosX;
float normalMixerPosY;

// global settings seamless parameters

static SeamlessMode seamlessMode;
Expand All @@ -496,12 +508,15 @@ class FBOImageProporties{
static map<QString,int> materialIndices;
static int currentMaterialIndeks;



FBOImageProporties(){

//ref_fbo = NULL;
fbo = NULL;
//aux_fbo = NULL;
//aux2_fbo = NULL;
normalMixerInputTexId = 0;
glWidget_ptr = NULL;
bFirstDraw = true;
bGrayScale = false;
Expand Down Expand Up @@ -597,6 +612,18 @@ class FBOImageProporties{

seamlessMode = SEAMLESS_NONE;



// normal map mixer
bNormalMixerEnabled = false;
bNormalMixerApplyNormals = false;
normalMixerDepth = 0.0;

normalMixerScale = 1.0;
normalMixerAngle = 0.0;
normalMixerPosX = 0.0;
normalMixerPosY = 0.0;

}

void copySettings(FBOImageProporties &src){
Expand Down Expand Up @@ -693,6 +720,15 @@ class FBOImageProporties{
selectiveBlurMaskInputImageType = src.selectiveBlurMaskInputImageType;
selectiveBlurNoIters = src.selectiveBlurNoIters;

// normal map mixer
bNormalMixerEnabled = src.bNormalMixerEnabled;
bNormalMixerApplyNormals = src.bNormalMixerApplyNormals;
normalMixerDepth = src.normalMixerDepth;

normalMixerScale = src.normalMixerScale;
normalMixerAngle = src.normalMixerAngle;
normalMixerPosX = src.normalMixerPosX;
normalMixerPosY = src.normalMixerPosY;

}

Expand Down Expand Up @@ -751,7 +787,11 @@ class FBOImageProporties{
if(glWidget_ptr != NULL){
qDebug() << Q_FUNC_INFO;
glWidget_ptr->makeCurrent();

if(glIsTexture(normalMixerInputTexId)) glWidget_ptr->deleteTexture(normalMixerInputTexId);
if(glIsTexture(scr_tex_id)) GLCHK(glWidget_ptr->deleteTexture(scr_tex_id));
normalMixerInputTexId = 0;
scr_tex_id = 0;
glWidget_ptr = NULL;
if(fbo != NULL ) delete fbo;
}
Expand Down
47 changes: 43 additions & 4 deletions Sources/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ QMatrix4x4& AwesomeCamera::updateCamera(void){
updown_direction
);
}
rotM = unit_mat;
return rotM;

return unit_mat;
}
QVector3D AwesomeCamera::get_position(){
if(isFree){
Expand Down Expand Up @@ -98,7 +98,38 @@ void AwesomeCamera::moveDown(float speed){

void AwesomeCamera::rotateView(float z_angle,float x_angle){

rotM.setToIdentity();
// rotM.setToIdentity();


double cosPhi = cos(mouse_sens*(-z_angle)/180*M_PI);
double sinPhi = sin(mouse_sens*(-z_angle)/180*M_PI);


direction = QVector3D(cosPhi*direction.x()+sinPhi*direction.z(),direction.y(),
cosPhi*direction.z()-sinPhi*direction.x());

QMatrix4x4 rotMat;
rotMat.setToIdentity();
rotMat.rotate(mouse_sens*(-x_angle),QVector3D::crossProduct(direction,QVector3D(0,1,0)));
QVector3D tmpVec = (rotMat*QVector4D(direction)).toVector3D();
tmpVec.normalize();
double angleTheta = QVector3D::dotProduct(tmpVec,QVector3D(0,1,0));
if(qAbs(angleTheta) < 0.9){
rotMat.setToIdentity();
rotMat.rotate(mouse_sens*(-x_angle)*(1-qAbs(angleTheta)),QVector3D::crossProduct(direction,QVector3D(0,1,0)));
QVector3D tmpVec = (rotMat*QVector4D(direction)).toVector3D();
tmpVec.normalize();
direction = tmpVec;
}

side_direction = QVector3D(cosPhi*side_direction.x()+sinPhi*side_direction.z(),0,
cosPhi*side_direction.z()-sinPhi*side_direction.x());

updown_direction = QVector3D::crossProduct(direction,side_direction);



/*
rot_angles[0] += mouse_sens*(z_angle);//przesuniecie X
rot_angles[1] -= mouse_sens*(x_angle);//przesuniecie Y
if(rot_angles[1] > 90) rot_angles[1] = 90;
Expand All @@ -109,13 +140,21 @@ void AwesomeCamera::rotateView(float z_angle,float x_angle){
side_direction = QVector3D(sin((rot_angles[0]+90)/180*M_PI),0,-cos((rot_angles[0]+90)/180*M_PI));
// przesuwanie gora dol
updown_direction = QVector3D::crossProduct(direction,side_direction);
*/

direction.normalize();
side_direction.normalize();
updown_direction.normalize();
}

}

void AwesomeCamera::reset(){
radius = 1;
position = QVector3D(0,0,0);
direction = QVector3D(0,0,1);
side_direction = QVector3D(1,0,0);
updown_direction = QVector3D(0,1,0);
}

void AwesomeCamera::mouseWheelMove(int direction){
radius+=mouse_sens*0.0025f*direction;
Expand Down
4 changes: 2 additions & 2 deletions Sources/camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class AwesomeCamera
void toggleFreeCamera(bool free);
bool isFreeCamera(){return isFree;}
void mouseWheelMove(int direction);

void reset();

void moveForward(float speed); // ruch do przodu - zwykle klawisz W
void moveBackward(float speed); // ruch do tylu - klawisz S
Expand Down Expand Up @@ -57,7 +57,7 @@ class AwesomeCamera
void setMouseSensitivity(int value);

public:
QMatrix4x4 rotM;
QMatrix3x3 rotM;
QVector3D position; // pozycja obserwatora
QVector3D direction; // kierunek patrzenia
QVector3D side_direction; //kierunek chodzenia na bok
Expand Down
4 changes: 4 additions & 0 deletions Sources/content.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,9 @@
<file>resources/filters.frag</file>
<file>resources/filters_3d.frag</file>
<file>resources/filters_3d.vert</file>
<file>resources/showMaterials.png</file>
<file>resources/showUVs.png</file>
<file>resources/resetCamera.png</file>
<file>resources/centerCamCursor.png</file>
</qresource>
</RCC>
Loading

0 comments on commit b212a52

Please sign in to comment.