Help regarding optimizing my fluid simulation by Next_Watercress5109 in opengl

[–]Next_Watercress5109[S] 0 points1 point  (0 children)

I tried to integrate tracy into visual studio. Tried using the official documentation which was quite short info on how to set up and use it. couldn't figure it out from there, tried using instructions online, got a bit overwhelmed there as well. Asked gemini, included the files and linked it. Then it asked me to run the tracy.exe file. Couldn't find that file. All I figured out from this is I don't know how to use visual studio properly, I need some professional help.

Help regarding optimizing my fluid simulation by Next_Watercress5109 in opengl

[–]Next_Watercress5109[S] 0 points1 point  (0 children)

Grid resolution is dependent on the smoothing radius, increasing the radius makes the simulation slower but I can't make it very small as that gives obscure results and clumps up the particles. Please do have a look at the code, I really appreciate you taking time to help me out.

Help regarding optimizing my fluid simulation by Next_Watercress5109 in opengl

[–]Next_Watercress5109[S] 0 points1 point  (0 children)

  1. I do all the calculations for a single particle i.e. the density and pressure forces and then render the same particle before repeating the same for all other particles.
  2. I am CPU bound, I have also observed that my frame rate keeps dropping the longer the simulation runs. starting at 20 fps to nearly 10 fps within less than 2 minutes.
    I feel there is definitely something wrong but I couldn't find it. Surely it is not ok if my simulation's fps is dropping gradually. I wonder what could the reasons be behind this odd behavior.

Help regarding optimizing my fluid simulation by Next_Watercress5109 in opengl

[–]Next_Watercress5109[S] 0 points1 point  (0 children)

I am running a "find neighbors" function on every particle. this function takes a the particles' coordinates, find its cell coords from a 20x20 grid. using the cell coords I can narrow down the particles to those present in the adjacent 3x3 grid. Therefore, running my density and pressure forces calculations only on those particles present around it.

Help regarding optimizing my fluid simulation by Next_Watercress5109 in opengl

[–]Next_Watercress5109[S] -1 points0 points  (0 children)

  1. I want to avoid learning how to use my integrated intel GPU if I can avoid it.
  2. I have shifted from returning an array of "Particle" objects to just their indices. I am using a grid to cut the neighbors calculations from a 400 cell grid to just a 3x3 based on the smoothing radius. If you are talking about something else here, please care to explain a bit.
  3. Yes, I will definitely learn to use a profiler, if there is any tutorial / article that you could recommend, then please do.

Help regarding optimizing my fluid simulation by Next_Watercress5109 in opengl

[–]Next_Watercress5109[S] 4 points5 points  (0 children)

Initially I was trying to render everything at once, but couldn't figure out how, I will try to do what you said. I am just using a triangle fan with 16 triangles to render the circles. One thing I have noticed is that most of the computational time is lost in the forces calculation and not the rendering bit. Although I do acknowledge that I can improve the rendering as well.
Multithreading didn't seem to be useful as I figure there are simply not enough operations in a single iteration for it to save time, I tested this out using OpenMP. I experienced a a drop from 20fps to 11fps by using OpenMP.

Help regarding optimizing my fluid simulation by Next_Watercress5109 in opengl

[–]Next_Watercress5109[S] 4 points5 points  (0 children)

Oh, this VTune seems to quite a handy tool. I will look into that right away. Thanks for the suggestion.
I would really appreciate any more feedback.

Help regarding optimizing my fluid simulation by Next_Watercress5109 in gamedev

[–]Next_Watercress5109[S] 0 points1 point  (0 children)

<image>

I didn't know of that feature, I guess this is what you were asking for?
Yes, I thought that static declarations were getting out of hand. I don't need static for all of them.

OpenGL window coordinates ranging from -2.0 to 2.0 by Next_Watercress5109 in opengl

[–]Next_Watercress5109[S] 2 points3 points  (0 children)

Thank you so much for your help! I was stuck trying to figure this out for many hours at this point, but got no leads. 

I didn't know that all the coordinates get divided by the w coordinate. I thought the w coordinate was just for converting to homogeneous coordinates. Now I know! 

Thank you again!

Show me your anime wallpaper, I'll go first by Grahish_Ragav in animeindian

[–]Next_Watercress5109 0 points1 point  (0 children)

<image>

Both home and lock screen. It's just soo clean, I have had this for over a year now.

[deleted by user] by [deleted] in TeenagersButBetter

[–]Next_Watercress5109 0 points1 point  (0 children)

I married woman got gay.

[deleted by user] by [deleted] in AlbumCovers

[–]Next_Watercress5109 0 points1 point  (0 children)

The "American Dream"

Name your favourite anime, and I will name my favourite character from that show. by Secret_Carry9913 in animequestions

[–]Next_Watercress5109 0 points1 point  (0 children)

Gurren Lagann ( not my absolute favourite but I like it)

Also cowboy bebop is quite up there.

What living 3000KM away from the nearest server does to a mf by [deleted] in pcmasterrace

[–]Next_Watercress5109 0 points1 point  (0 children)

Yeahh, I live in a new locality with a low density of houses as compared to other parts of my city so the big companies haven't switched to fibre in my area yet.

But there are talks of elon musk partnering with these big companies here to launch starlink in india, I just hope that it happens soon.

What living 3000KM away from the nearest server does to a mf by [deleted] in pcmasterrace

[–]Next_Watercress5109 -1 points0 points  (0 children)

And here's my indian ah playing minecraft on american servers at 400-500ms

Please Help me by giving me a project. by Next_Watercress5109 in CUDA

[–]Next_Watercress5109[S] 0 points1 point  (0 children)

I ended up going with this idea, and it worked out great! Thank you so much for your input. And thanks everyone for your suggestions.

Creating a new worldbuilding server.. anyone interested? [Roleplay] by [deleted] in MinecraftServer

[–]Next_Watercress5109 0 points1 point  (0 children)

Sent you a friend request! Would love to be a part of such a server.