Questions about OpenCL and OpenMP

A7cf6a84bd427727dc5f992b74d5b72f
0
Eliasmasche 101 Feb 14, 2013 at 23:21 memory opencl performance programming

I am in the process of my Game Engine, I want implement a system of streaming to create big maps or terrain so i need a system of stream to avoid overloading of memory,cpu.
For example: my terrain will be the size of 100x100km or more. and more the entities,objects,etc will need very powerfull machine to run.
I need a streaming system to avoid this. and see the more used, easy to learn is OpenCL and OpenMP(Another think is, i using OpenCL to my physics system with Bullet Engine).
So what recommend me OpenCL or OpenMP and can tell me about tips,reviews,experience,problems,Who is more difficult?. using this streaming languages ,Another think that round my head is about OpenCL is can work with CPU?. so can use that too so for example: a person don´t have a very good GPU so can use the CPU.
Also don´t there a OpenCL SDK or IDE official of Khronos Group only the company Intel,IBM,Nvidia,AMD have a SDK(Here can see more http://en.wikipedia.org/wiki/OpenCL#OpenCL-conformant_products) then exits a tools or something to programming with OpenCL and my same code can use the AMD,Nvidia Cards and CPU, if don´t exits can programming in the Nvidia SDK(Because i have Card Nvidia) and later my code can use the AMD card or need modify in SDK of AMD, later pass to have SDK of IBM to use in CPU, But using this process i complicating things and for game engine is no usefull.
Soo with OpenMP don´t have this type of problem if can´t use OpenCL.

Thanks for looking more to help me, Sorry if i wrong writing, I still learning English and don´t write very well.

4 Replies

Please log in or register to post a reply.

6837d514b487de395be51432d9cdd078
0
TheNut 179 Feb 15, 2013 at 15:46

You don’t need OpenCL or OpenMP to handle streaming landscapes. OpenCL is designed to leverage your GPU to perform computationally expensive tasks. It can also be configured to use the CPU, but it may be more hassle than just writing or using a multithreading library. OpenMP is just a standard for parallel programming. It’s quite similar to Intel’s compiler in how it will try to parallelize your code, but it’s more of a manual effort. Personally I think it obfuscates the code to much and I prefer to traditionally design multithreaded systems.

What you really need is an algorithm to efficiently stream large texture data. One of the most popular techniques is to create mipmaps of your textures. Using some sort of mipmap LOD calculation, you will sample terrain data from the highest quality (slowest) to the lowest quality (fastest) textures. In some implementations, such as Bing Maps, they work from the bottom up. It will show you the lowest mipmap level first and then work its way up to the higher quality textures over time. This method of streaming allows for quick traversal of areas without bogging down the system by constantly loading the high quality data first.

Here are some links.
1. GPU Gems Geo Clipmaps (how to efficiently render terrain)
2. Deep Zoom (a system for mipmapping large textures)

A7cf6a84bd427727dc5f992b74d5b72f
0
Eliasmasche 101 Feb 16, 2013 at 03:19

Thx so much for the help, Now can advance with my engine and i have a sight more clear view about streaming system.
And what question, i think for my system of physics i using Bullet Engine, I see Bullet engine can combine with OpenCL, You think well be good to use with OpenCL?
And sorry for bothering but you know where can find more books about render terrain and streaming and if can posible books about create a terrain landscape generator 3D

Thx again for the help.

6837d514b487de395be51432d9cdd078
0
TheNut 179 Feb 16, 2013 at 18:46

It depends on how physics intense your game will be. Generally, these physics libraries run well on the CPU so there’s not a demanding need to run them on the GPU. In fact, every game that I’ve played calculates physics on just the CPU or at least has a fallback option if you don’t support GPU physics. Keep in mind that if you run physics on the GPU, you will need to share the GPU with your renderer. Might not be a big problem for some, but it can be a problem. With today’s multicore CPUs, you might as well put them to use and utilize the GPU to maximize your rendering capabilities. That to me is the best route for parallelization.

I don’t have any books I can recommend you. I mostly read white papers and online journals, academic type stuff. Maybe someone around here can recommend you something, or try Amazon.

A7cf6a84bd427727dc5f992b74d5b72f
0
Eliasmasche 101 Feb 17, 2013 at 01:44

ok thanks again for the great help, because in my engine i want of destructible word, all the word, buildings,terrain, style of the engine frostbite and Battlefields 3, i know frostbite have a great team and proffesional so to me we take me time to create a great physics engine with that capabilities, so i tink to use the GPU with OpenCL.