Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3D viewport navigation lags back to origin #33

Closed
nevr2k opened this issue Apr 4, 2015 · 15 comments
Closed

3D viewport navigation lags back to origin #33

nevr2k opened this issue Apr 4, 2015 · 15 comments

Comments

@nevr2k
Copy link

nevr2k commented Apr 4, 2015

Hey Krzysztof,

i am running arch (kernel 3.19.2) and have some issues using the current AB master:

  • the compile produces warnings (qt 5.4.1)
  • the program runs but 3d viewport navigation is not working (lags back to starting location when trying to navigate)
  • used command line and also tried qtcreator folowing the build pdf

./linuxBuildScript.sh
WARNING: target.path is not defined: install target not created
mainwindow.ui: Warning: The name 'layoutWidget' (QWidget) is already in use, defaulting to 'layoutWidget1'.

glwidget.cpp:708:11: warning: enumeration value ‘MAX_TEXTURES_TYPE’ not handled in switch [-Wswitch]
switch(tType){
^
mainwindow.cpp:996:35: warning: unused parameter ‘size’ [-Wunused-parameter]
void MainWindow::changeWidth (int size){
^
mainwindow.cpp:1002:35: warning: unused parameter ‘size’ [-Wunused-parameter]
void MainWindow::changeHeight(int size){
^
mainwindow.cpp:1189:48: warning: unused parameter ‘indeks’ [-Wunused-parameter]
void MainWindow::updatePerformanceSettings(int indeks){
^
mainwindow.cpp:1632:38: warning: unused parameter ‘index’ [-Wunused-parameter]
void MainWindow::setOutputFormat(int index){
^
utils/Mesh.cpp:109:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(unsigned int i = 0 ; i < gl_vertices.size() ; i++ ){
^
utils/Mesh.cpp:152:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for( int k = 0 ; k < verlet[i].size() ; k++){
^
utils/Mesh.cpp:155:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for( int l = 0 ; l < verlet[i].size() ; l++){
^
utils/Mesh.cpp:342:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (unsigned int a = 0; a < vertexCount/3; a++)
^
utils/Mesh.cpp:387:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (unsigned int a = 0; a < vertexCount; a++)
^
formsettingsfield.cpp:117:45: warning: unused parameter ‘text’ [-Wunused-parameter]
void FormSettingsField::nameChanged(QString text){
^
formsettingscontainer.cpp:72:63: warning: unused parameter ‘field’ [-Wunused-parameter]
void FormSettingsContainer::reloadSettings(FormSettingsField* field){
^
utils/qglbuffers.cpp:373:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(unsigned int i = 0;i< attachments.size();i++){
^

@kmkolasinski
Copy link
Owner

Hi, I was on holidays. Can you check older versions of AB?
I've added the "mouse loop" feature recently which I think does the problem in your case.

@nevr2k
Copy link
Author

nevr2k commented Apr 8, 2015

Hey there, np thanks for the follow up.

i tried 2.1 but i cant get it compiled - getting an error

/usr/lib/qt/bin/rcc -name content ../content.qrc -o qrc_content.cpp
Makefile:597: recipe for target 'qrc_content.cpp' failed
RCC: Error in '../content.qrc': Cannot find file 'content/Capsule.obj'
make: *** [qrc_content.cpp] Error 1
17:44:55: The process "/usr/bin/make" exited with code 2.

@kmkolasinski
Copy link
Owner

Ok, I know where is the problem.
Please remove the Capsule.obj file from the content.qrc file.
You can do it through the Qt creator or just by opening this file
in any text editor and remove the line:
content/Capsule.obj

@Robert42
Copy link
Contributor

Robert42 commented Apr 9, 2015

Hey, I also have the 3d viewport navigation problems.

I think, there are two different problems. The error described in this issue (the navigation lags back to origin) occures the first time in the commit be8bb6f (I have used git bisect)

But I had a second issue, that the viewport lags for one or two seconds. That issue is already reproducable in 2.x versions.
Edit: I think I was able to workaround the second issue by replacing all updateGL calls with a new function markDirty, which makes sure, that updateGL will be queued (exactly once) for the next main-loop execution.
But I am currently to tired to create a pull request, this will have to wait for tomorrow.

@kmkolasinski
Copy link
Owner

Ok, thanks for info. I'm waiting for P-R.

@Robert42
Copy link
Contributor

Ok, my Pull Request is online. But I don't like it, because it's somehow ugly. You can use if you want. Maybe you just want to look at it and develop a better solution.

@kmkolasinski
Copy link
Owner

Ok, thanks. Yeah its a really big pull request.
Can you try something simpler before I do your pull request?
You can disable all image processings during the mouse dragging:

You need to add one new variable: e.g: bool bMouseDragging; in class GLImage.
In cpp file you can find such line:
if(!bSkipStandardProcessing){
change it to something like that:
if(!bSkipStandardProcessing && !bMouseDragging){
then in function:
void GLImage::mousePressEvent(QMouseEvent *event)
add line:
bMouseDragging = true;
and in:
void GLImage::mouseReleaseEvent(QMouseEvent *event){
add line:
bMouseDragging = false;
and updateGL() at the end.

What about that? I know that you will lost all image effects during mouse dragging, but such solution is much simpler.

@Robert42
Copy link
Contributor

Ok, I've tried the bMouseDragging trick, but I couldn't see a difference between "before" and "after" using bMouseDragging to controll the image effects

@kmkolasinski
Copy link
Owner

Ok thank, I was courious, because It should help to reduce the GPU computation time, but if the problem is in drivers as you wrote, your solutions will be better. I will take a look at your PR this evening.

@kmkolasinski
Copy link
Owner

Ok, I did the merge. Once again thanks for this fix, I see improvement!
Can you check new commit just in case? If everything will be ok, you can close this issue.

@Robert42
Copy link
Contributor

You're welcome :)
I've checked, and it looks ok for me.

@nevr2k
Copy link
Author

nevr2k commented Apr 12, 2015

i will give it a try with this improvement.
fixing and using the 2.1 compile by removing Capsule.obj is not an option for me

@kmkolasinski
Copy link
Owner

Ok, please give me a feedback if it works now.

@nevr2k
Copy link
Author

nevr2k commented Apr 12, 2015

works flawlessly.

thanks a lot from my side Robert for the fix/PR and Krzysztof for PR check implement and of curse making and maintaining AB : -)

@kmkolasinski
Copy link
Owner

Ok, I'm closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants