Using High Performance GPU

I have a laptop equipped with an external and an on-board GPU. Through the settings of the nvidia panel I can determine when to use GPU. However, I couldn't make the processing use it. Therefore when I run a sketch doing tint, resize and similar operations on multiple images, I got something around 9 FPS, which is quite low.

Any Idea how can I improve the speed by using GPU ? Or do you think using the external GPU would make any difference ?

Tagged:

Answers

  • Most laptop gpu's are still bad. Did you try OpenGL?

    Also some code would help, that way we can tell what slows it down so much.

  • you are sure you are not using the external gpu. did you should check it with a tool liek gpu-z? there should be tools in the grahics card controls that you can use to specify which graphics card to use. maybe you have to specify that all java programs should use the external gpu.

  • I'm not sure, but I think calling resize, filter and blend on a PImage object might not use the GPU at all.

    Why do you want to resize the image? Can't you simply draw it larger and smaller without resizing the PImage? I would use the P2D or P3D mode and use texture() to apply the image to a shape(). You can use translate(), rotate() and scale() to change the position, rotation and size of the image.

    You can also use shaders to create the effects, which are rendered by the GPU.

    Here some blend mode shader examples. But you should delete all the "else if" statements you don't need from the .glsl file, otherwise using the last effect can be slow (because it first compares if you are trying to use one of the first 24 effects, only to discover that you want the last one).

Sign In or Register to comment.