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

GLSL runs really slow! #2

Closed
shaohuawan opened this issue Jan 9, 2012 · 7 comments
Closed

GLSL runs really slow! #2

shaohuawan opened this issue Jan 9, 2012 · 7 comments

Comments

@shaohuawan
Copy link

Hi,

The FaceSubstitution/FaceSubstitution example code runs extremely slow on my machine, with a frame rate of less than 1fps.
And the FaceSubstitution/CloningWrapper example code runs also extremely slow on my machine, with a frame rate of less than 1fps.

I have found that when the two two calls to maskedBlur(src, mask, srcBlur) are commented out from FaceSubstitution/CloningWrapper/src/Cloning.cpp, my program would speed up.

Therefore, maskedBlur(ofTexture& tex, ofTexture& mask, ofFbo& result) in FaceSubstitution/CloningWrapper/src/Cloning.cpp is the function that is slowing everything down.

But I don't know why it would slow down my program. And I don't know how to solve this problem.

Do you have any idea of what is happening?

Regards,
Shaohua Wan

@kylemcdonald
Copy link
Collaborator

maskedBlur is necessarily a resource-intensive operation. on modern machines it should not be a problem, but on older machines, or machines where the GLSL it is emulated in software, you will have a problem.

i recommend trying the CPUCloning example instead, and then rewriting the CloningWrapper to use the CPU.

@shaohuawan
Copy link
Author

Thanks for your reply.
My machine is a 3.8GHz machine with a 8Gb RAM. And it has a Intel Core i7 Processor. It is a really powerful machine. I don't know why the program runs so slow on it.
Anyway, how to determine GLSL is emulated in software?

In addition, the CPUCloning example runs very fast.

@kylemcdonald
Copy link
Collaborator

if you have a computer that has a switchable graphics card, it could be using the slower of the two.

or if the GLSL shader is using a feature that is not supported by the graphics card, then it could be falling back to emulation mode.

normally on OSX i use the opengl shader builder to let me know whether it's running in software mode or not. if you're on linux or windows, i'm not sure which tool to use.

maybe this line is confusing your graphics card:

#extension GL_ARB_texture_rectangle : enable

you could try removing that.

sorry i can't be more help!

@shaohuawan
Copy link
Author

Thanks anyway. I will try. :)

@shaohuawan
Copy link
Author

Problem solved!
After I install a new driver for my graphic card, my program now runs perfectly smooth. Thanks!
My graphic card is GeForce GT 530. The old driver version number was 8.17.12.6795. After I install a new driver for my machine, now it works flawlessly.
Thanks!

@kylemcdonald
Copy link
Collaborator

hey great to hear! maybe post a link to the new graphics card driver, in case someone else has the same problem? then they can find the answer faster.

@shaohuawan
Copy link
Author

If you are using Ubuntu 11.10, then by default the proprietary graphics driver are not loaded. You have to load it manually in order for the graphic card to work properly. Here is how to do it.

  1. Choose "Additional Drivers" from "System Settings";
  2. Choose "NVIDIA accelerated graphics driver(post-release updates)(version current-updates)" from "Additional Drivers";
  3. Click "Activate"
    Then we are done.

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

2 participants