Page 1 of 1

[closed] Using OpenCL in Minetest client and/or server

PostPosted: Fri May 09, 2014 17:58
by Hybrid Dog
Split from this topic

Calinou wrote:This is likely possible, but demanding on the hardware and not easy to implement.

Improving graphics is easier done by enabling anti-aliasing, add this line in minetest.conf:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
fsaa = 4
In my opinion fsaa (fast sample antialiasing) reduces the graphics quality. Sometimes I use fxaa (fast approximate antialiasing), which smooths the corners only if they are diagonal.




Please add a setting to allow minetest to use OpenCl.




davidforsure!!! wrote:So i saw a mod called SHADOWS that adds nice shadow in the game. its just like shaders but more unrealistic but its works fine.....

thanks. (I suppose you mean my simple and slow shadows mod.)
I need to change it that it works faster. The current version is just the first one which works. I may use voxelmanipulation to change the light at the specific positions instead of adding dark nodes there...

Re: Is shaders will be implemented

PostPosted: Fri May 09, 2014 18:32
by sfan5
Hybrid Dog wrote:Please add a setting to allow minetest to use OpenCL.

What benefits do you promise yourself from Minetest being able to use OpenCL?

Re: Is shaders will be implemented

PostPosted: Fri May 09, 2014 18:58
by Hybrid Dog
sfan5 wrote:
Hybrid Dog wrote:Please add a setting to allow minetest to use OpenCL.

What benefits do you promise yourself from Minetest being able to use OpenCL?

I thought the graphics card could be used for servers when the admin is afk to increase the maximum server performance instead of keeping the graphics card away from work if this setting is enabled.

Re: Is shaders will be implemented

PostPosted: Fri May 09, 2014 19:16
by sfan5
Hybrid Dog wrote:
sfan5 wrote:
Hybrid Dog wrote:Please add a setting to allow minetest to use OpenCL.

What benefits do you promise yourself from Minetest being able to use OpenCL?

I thought the graphics card could be used for servers when the admin is afk to increase the maximum server performance instead of keeping the graphics card away from work if this setting is enabled.

OpenCL is mainly useful for ongoining heavy calculations.
I don't think usage of OpenCL will be able to make e.g. lightning calculations faster.

Re: Is shaders will be implemented

PostPosted: Fri May 09, 2014 19:22
by Hybrid Dog
sfan5 wrote:
Hybrid Dog wrote:
sfan5 wrote:What benefits do you promise yourself from Minetest being able to use OpenCL?

I thought the graphics card could be used for servers when the admin is afk to increase the maximum server performance instead of keeping the graphics card away from work if this setting is enabled.

OpenCL is mainly useful for ongoining heavy calculations.
I don't think usage of OpenCL will be able to make e.g. lightning calculations faster.

You haven't tried it yet.
http://www.luxrender.net/wiki/GPU

Re: Is shaders will be implemented

PostPosted: Fri May 09, 2014 19:26
by Calinou
Graphic cards excel in highly parallel uses. Are there any in Minetest client or server?

Re: Using OpenCL in Minetest client and/or server

PostPosted: Fri May 09, 2014 19:40
by PilzAdam
Most of the big servers are dedicated servers without a graphics card.

Re: Is shaders will be implemented

PostPosted: Fri May 09, 2014 19:57
by sfan5
Hybrid Dog wrote:
sfan5 wrote:
Hybrid Dog wrote:I thought the graphics card could be used for servers when the admin is afk to increase the maximum server performance instead of keeping the graphics card away from work if this setting is enabled.

OpenCL is mainly useful for ongoining heavy calculations.
I don't think usage of OpenCL will be able to make e.g. lightning calculations faster.

You haven't tried it yet.
http://www.luxrender.net/wiki/GPU

LuxRender tries to render a realistic light environment, this is used for e.g. rendering a Blender scene.
Minetests lightning code however is very simple and won't benefit from utilizing OpenCL.

Re: Is shaders will be implemented

PostPosted: Fri May 09, 2014 20:07
by Hybrid Dog
sfan5 wrote:LuxRender tries to render a realistic light environment, this is used for e.g. rendering a Blender scene.
Minetests lightning code however is very simple and won't benefit from utilizing OpenCL.

I think a different lighting method could be added which can be en- and disabled via another setting.

Re: Is shaders will be implemented

PostPosted: Fri May 09, 2014 20:21
by sfan5
Hybrid Dog wrote:
sfan5 wrote:LuxRender tries to render a realistic light environment, this is used for e.g. rendering a Blender scene.
Minetests lightning code however is very simple and won't benefit from utilizing OpenCL.

I think a different lighting method could be added which can be en- and disabled via another setting.

You are aware that LuxRender is for rendering scenes and not just lightning alone?
Rendering the scene on the server would be 342.61% inefficent.

Re: Is shaders will be implemented

PostPosted: Fri May 09, 2014 20:38
by Hybrid Dog
sfan5 wrote:
Hybrid Dog wrote:
sfan5 wrote:LuxRender tries to render a realistic light environment, this is used for e.g. rendering a Blender scene.
Minetests lightning code however is very simple and won't benefit from utilizing OpenCL.

I think a different lighting method could be added which can be en- and disabled via another setting.

You are aware that LuxRender is for rendering scenes and not just lightning alone?
Rendering the scene on the server would be 342.61% inefficent.

I don't mean the LuxRender, which is just an example for the use of OpenCL google showed me, I mean shadows and reflections viewtopic.php?f=5&t=9251 .

Re: Is shaders will be implemented

PostPosted: Fri May 09, 2014 21:04
by sfan5
Hybrid Dog wrote:
sfan5 wrote:
Hybrid Dog wrote:I think a different lighting method could be added which can be en- and disabled via another setting.

You are aware that LuxRender is for rendering scenes and not just lightning alone?
Rendering the scene on the server would be 342.61% inefficent.

I don't mean the LuxRender, which is just an example for the use of OpenCL google showed me, I mean shadows and reflections viewtopic.php?f=5&t=9251 .

GLSL is better suited for shadows because it has, unlike OpenCL, direct access to all graphical features.

Re: Is shaders will be implemented

PostPosted: Sat May 10, 2014 08:29
by Hybrid Dog
sfan5 wrote:GLSL is better suited for shadows because it has, unlike OpenCL, direct access to all graphical features.

ok

Re: Using OpenCL in Minetest client and/or server

PostPosted: Sat May 24, 2014 12:09
by Hybrid Dog
What about using OpenCL for chunkloading?

Re: Using OpenCL in Minetest client and/or server

PostPosted: Sat May 24, 2014 12:39
by cheapie
Look here, specifically at the top and bottom graphs. That's VanessaE's server machine, running seven instances of minetestserver. The top graph is CPU usage (400% is full load, as it's a dual-core "4-thread") and the bottom is the number of players online.

As you can see, it rarely goes above half CPU usage except for the occasional spike (and nightly backup) even with 10-20 players. I have also witnessed over 20 players on one (lightly-modded) server with very minimal lag.

This server has no GPU installed (using integrated) so OpenCL would actually be slower than using the CPU on this box. The only thing I could possibly see it being useful for on any machine would be if there was a command to generate large portions of the map at once.

Re: Using OpenCL in Minetest client and/or server

PostPosted: Sat May 24, 2014 13:25
by aldobr
maybe opencl terrain generation ?

does it makes sense ?

looks preeeetty fast :

http://www.youtube.com/watch?v=-NryquDyQlc

Re: Using OpenCL in Minetest client and/or server

PostPosted: Sat May 24, 2014 13:44
by aldobr
GLSL simplex noise generator :

https://github.com/ashima/webgl-noise

Re: Using OpenCL in Minetest client and/or server

PostPosted: Sat May 24, 2014 15:37
by sfan5
Hybrid Dog wrote:What about using OpenCL for chunkloading?

What do you promise yourself of doing that?
And what part of chunk loading would you do in OpenCL?
Disk I/O is not something you can do with OpenCL.
aldobr wrote:GLSL simplex noise generator :

https://github.com/ashima/webgl-noise

OpenGL != OpenCL

Re: Using OpenCL in Minetest client and/or server

PostPosted: Sat May 24, 2014 18:03
by Hybrid Dog
sfan5 wrote:
Hybrid Dog wrote:What about using OpenCL for chunkloading?

What do you promise yourself of doing that?
And what part of chunk loading would you do in OpenCL?
Disk I/O is not something you can do with OpenCL.

I think it could improve the chunkloading speed for the player who needs to wait until the fps count rises up again.
I noticed that you need a fast processor to reduce the chunkloading fps drop instead of a good graphics card.


cheapie wrote:Look here, specifically at the top and bottom graphs. That's VanessaE's server machine, running seven instances of minetestserver. The top graph is CPU usage (400% is full load, as it's a dual-core "4-thread") and the bottom is the number of players online.

As you can see, it rarely goes above half CPU usage except for the occasional spike (and nightly backup) even with 10-20 players. I have also witnessed over 20 players on one (lightly-modded) server with very minimal lag.

This server has no GPU installed (using integrated) so OpenCL would actually be slower than using the CPU on this box. The only thing I could possibly see it being useful for on any machine would be if there was a command to generate large portions of the map at once.
of course a setting to enable/disable it should be added

Re: Using OpenCL in Minetest client and/or server

PostPosted: Sat May 24, 2014 18:43
by aldobr
OpenGL != OpenCL


Well, regardless of language/framework used, the basic idea of the thread is to offload calculations from the CPU to the GPU, and I just wanted to show that some tasks CAN be offloaded, like chunk generation.

the example in the video shows how ridiculously fast chunk generation becomes when offloaded to the GPU.

Re: Using OpenCL in Minetest client and/or server

PostPosted: Sat May 24, 2014 20:18
by webdesigner97
Hybrid Dog wrote:
sfan5 wrote:
Hybrid Dog wrote:What about using OpenCL for chunkloading?

What do you promise yourself of doing that?
And what part of chunk loading would you do in OpenCL?
Disk I/O is not something you can do with OpenCL.

I think it could improve the chunkloading speed for the player who needs to wait until the fps count rises up again.
I noticed that you need a fast processor to reduce the chunkloading fps drop instead of a good graphics card.


cheapie wrote:Look here, specifically at the top and bottom graphs. That's VanessaE's server machine, running seven instances of minetestserver. The top graph is CPU usage (400% is full load, as it's a dual-core "4-thread") and the bottom is the number of players online.

As you can see, it rarely goes above half CPU usage except for the occasional spike (and nightly backup) even with 10-20 players. I have also witnessed over 20 players on one (lightly-modded) server with very minimal lag.

This server has no GPU installed (using integrated) so OpenCL would actually be slower than using the CPU on this box. The only thing I could possibly see it being useful for on any machine would be if there was a command to generate large portions of the map at once.
of course a setting to enable/disable it should be added

If this would work, then I would be very happy. I have massive framedrops while loading chunks. CPU: AMD FX 4130, GPU XFX Radeon HD 7770...