🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Library for multiple pixels manipulation

Started by
7 comments, last by JoeJ 4 years, 4 months ago

Hello,

I would like to know if I can use openCV Or something similar for creating textures (parallax/bump maps etc). I am asking these, because I want to make procedural textures and I don’t want to use opengl‘s glsl per pixel drawing. I want to do it as opencv or processing is doing.

Hope I’ve made understandable and you can help me. :D

Thank you!

Advertisement

Maybe I am missing something, but as far as I know, a texture is just an image, right? So, literally anything that produces an image will do. If you think opencv works better for your problem, just go for it!

EDIT: Do you know about ImageMagick? never used it myself, but the description sounds like it could be useful to you

https://en.wikipedia.org/wiki/ImageMagick

ComputerVision

You are way above our pay grade

So this is for a non-game / offline purpose? You can't have an OpenGL context at all, not even “off screen” rendering to texture?

OpenCV can certainly do various image manipulation, or you can use OpenCL, CUDA, or one of many many CPU libraries. But I am not sure any have made an API to take some “OpenGL code” and run it under something else directly if that is what you are after.

Thank you all for your replies. What I really wanted to do, was for game development purposes. I was thinking to use opengl to attach an image to an model, and to make somehow to modify the image in real time with opencv.

For example, I have a cube and attach the blank texture to it. If I modify the texture with opencv (let's say I draw the image as a brick) this will update immediately on the model, without to re-run the application. Of course, I was thinking to use a GUI as well.

Another example could be the Spacescape application - by Alex Peterson. When you modify on the GUI, it modifies on the drawing area. ?

Was there a reason then to not use OpenGL to render to a texture then (RTT, using a framebuffer object FBO)?

There is some interoperability, but I can't see easily if there is a way to directly convert an OpenCV image to OpenGL texture, CUDA and OpenCL look like they can directly write an OpenGL texture resource.

alx119 said:
What I really wanted to do, was for game development purposes. I was thinking to use opengl to attach an image to an model, and to make somehow to modify the image in real time with opencv. For example, I have a cube and attach the blank texture to it. If I modify the texture with opencv (let's say I draw the image as a brick) this will update immediately on the model, without to re-run the application.

The usual way of doing this would be to modify the image with CPU and update the texture every frame for display. The update is no problem if the data is not huge.

I don't know about OpenCV. But it is possible to have interop from OpenCL with OpenGL (likely the same applies to CUDA). So you could avoid a need to download an image from GPU only to upload it again, if the image generation already happens on GPU.

Alternatively, nothing would stop you from implementing any image processing algorithms in OpenGL compute.

Edit: Sorry, i thought you have stated to use OpenGL but you did not. The same applies to DirectX, but you might want to be more specific if this matters.

This topic is closed to new replies.

Advertisement