biell2015 said:
I don't know a lot about shader, but if I'm not mistaken, you either can't calculate physics on the gpu or it's bad to do it, inefficient.
Shadertoy us a very educational resource, surely better than YT.
Regarding inefficiency your assumptions are just wrong. In general GPUs are good for parallel algorithms, but related functionality is available only in compute shaders.
Shadertoy is about pixel shaders, so each thread operates isolated form others. As this rules out any form of efficient data share, many examples form shadertoy are indeed inefficient and have to do a lot of redundant work. But that's irrelevant. You can still learn how various methods and algorithms work.
Since what you want to do requires to generate massive amounts of data, often only for visual purposes but not affecting game interactions and physics, there is probably no way around of using the power of the GPU. If you generate stuff on CPU this might be just too slow, and even if not it might be too slow to upload the data to GPU each frame. Memory transfer is a big bottleneck.
Personally i really like how GPUs work, but doing actual research and development on GPU is very tedious and cumbersome. Thus i prefer to develop everything on CPU first, and port it to GPU only after it works and i have figured everything out. This works well, but ofc. i must know how GPUs work precisely in advance to do so. When you feel ready, i recommend the computer shader chapter from the OpenGL Super Bible book to learn it, which explains the concepts of parallel programming with very good examples.
biell2015 said:
So, the gpu is good to make parallel stuff, drawing a lot of stuff at once, and the cpu is good to make nonparallel stuff, like calculating physics.
Mostly yes, but the quote is much too general. Firstly, ‘parallel stuff’ sounds a bit like ‘do shitloads of brute force’, as gfx programmers traditionally do for most. But that's not what parallel programming is about. GPUs can run complex algorithms, they can traverse trees, they can do hierarchical processing, reduce work to what's really needed, etc. There are certain limitations making programming harder, but they are general purpose processors these days, no longer just pixel accelerators.
It would make sense to solve the constraints from a physics engine on GPU for example, while detecting narrow phase collisions and generating contacts from various shapes would be pretty hard to handle efficiently, but possible as well.
biell2015 said:
I found the link, he is using Unity and cubes, but maybe if you just use points, that don't tecnically have vertices, you could maybe render billions of points.
A billion points would take something like 6 GB of VRAM. :D
You don't want to do that!
You want to have a representation of density, e.g. in a volume grid representing a galaxy. Each cell has density, representing the mass of glowing stars in it. That's enough. No need to know it's 5172 stars which make up this mass of stars in the cell.
The need to know this only once your spaceship travels close enough to the cell. Then you generate 5172 points, distributed procedurally respecting given density.
Only when you travel close to one of these points, you generate a star and it's planets, moons, mountains, 3 legged alien fish, strands of grass…
That's just an example of how to do it.
But you won't get there if you think in terms of ‘how many millions of cubes can Unity render?’, which is a pretty useless test anyway imo.
If you want to play god, you have to be smart. But brute force isn't smart. ; )
biell2015 said:
but No Man's Skys teached us that, exploring random planets empty of things can be boring.
Yeah. But well, many of us have this dream to generate an entire universe to explore, out of nothing.
And i think this dream is important to make us move forward.
So let's just assume we will manage to make it interesting and fun somehow, better than all the others before us did. :D
(I'm not in this camp btw. For me the Ubisoft scale of game worlds is already more than challenging enough. :D )
biell2015 said:
Data Oriented Programming is much faster than Object Oriented Programming
Really? Well - personally i don't read so much marketing claims about programming paradigms, Dots, or whatever people come up to extend their former limitations.
I do not even know if my work is more like the former or like the latter from these two buzzwords. : )
biell2015 said:
Well I love learning stuff, but it would be easier if people actually taught stuff.
Like Lorenzo, i also thought at first: Just upgrade so you can still use Unity.
But then i forgot to mention this. Maybe because i'm always happy to see people still attempting to do it all on their own, from scratch, from start to finish, without help and restrictions from U engines or now AI generated code.
But i want to warn you. I will take you many years to achieve your goals. Depending on ambitions. For me it's decades already. After that time i now feel i can do anything i want, finally. But i might be already too old to complete the game of my dreams. Lifetime is finite, and that's the limit.