I was asked to do an IT project for school and I would like to use CUDA in it.
I’m trying to simulate an anthill with many agents - ants and render it with DirectX.
I want user, to make .dds (or any other that DirectX and CUDA support) file to create an environment, for example big red (1.0f,0.0f,0.0f,1.0f) dot inside would be an anthill, scattered blue (0.0f,0.0f,1.0f,1.0f) dots would be food.
I want to load this texture to GPU then create lots of ants with some parameters like f_speed, f_xPos, f_yPos, b_carryingFood etc. and assign then to kernels (don’t know yet which strategy should I use 1 and per kernel or 1 ant per thread or something else).
Then ants start walking around.
When an ant is on the pixel it is white and when it leaves it changes back to black or to previous color.
When it steps on food it goes, in straight line, to the anthill to leave food in it.
- Is it possible to load texture from file, edit it in CUDA and render in DirectX?
- Is it possible to keep this texture in GPU memory, edit it in CUDA and render edited from GPU memory and don’t copy it back to host until simulation is over?
- Which sample from SDK would be the best to start with? I tried “simpleD3D11 Texture”, ants are “walking” but I can’t load and render my texture…
Could You please help me :)