godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.16k stars 97 forks source link

Make a visual script box that ' spawns ' objects, with 'GPU' physics or, so . . #2112

Closed jasperbrooks79 closed 2 years ago

jasperbrooks79 commented 3 years ago

Describe the project you are working on

A Tomb raider game . .

Describe the problem or limitation you are having in your project

I need to make stuff, like a gun or, machine rifle, that ' spits ' out bullets, and I'd like to use a particle system, to do it . . The problem is, particles are limited to, only 'working' each time the ' timer ' runs out, so a particle time, of 4 second, means if I press the button, to spawn bullets, fast . . then, it'll ' pause ' until ' the next four seconds . . alternatively I can write code, that ' spawns ' them, but I was wondering, since the GPU is better, if one could make a node or, code that spawns ' a particle ' ( object ), and runs it on the GPU . . GPUSpawner node or, so on . . I'm not sure, if this would work, and I think it'd need some special built-in methods and, property, to make sure it ' only ' does, what the GPU can do ( compared, to CPU particles ) . . but, this would potentially be a way of spawning massive amounts of particles or, objects, or so . . I need it, so when I pump out bullets, when a button is pressed or, such . . that it spawns as many, and as fast, as I need . . and, has minimum lag, so it's faster, as well . .

Is this possible, and could this be a new way, of making games run faster, not sure <3

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Well, current particles don't work for stuff like ' bullets ', bec. they can only ' emit ', every time the timer hits the ' life ' time, for 4 seconds, it can ' being a ' spawn, at 4 seconds, 8 seconds, 12 seconds, so on . . but, I need it to spawn, at any, given time, and as FAST as possible, since many things only need GPU processing, CPU particles can do a few things, more, I think, not sure . . well, I was wondering if that might be good, in my case I guess simply coding a ' spawn ' using the normal code wouldn't matter, but supposed I need to spawn 100.000 particles or, objects, could the GPU do that . .

I just want the game to run as fast, as possible, in real - time . .

But, it might be technical also, need to be written, for GDScript, not only visual script, or so . . even if people only spawned, say 10.000 fog particles, doing it via GPU, would still be faster, and over-all be more optimized = faster FPS, I hope, thanks <3 . .

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Well, a way to instantiate, using the GPU, instead of CPU, or so . . not sure how to code it, be nice if it was just something, that could be done, using GDScript, or visual script . . for stuff that could be run on CPU, like the bullets, it'd may-be still be faster, and give a frame - rate boost, over - all <3

If this enhancement will not be used often, can it be worked around with a few lines of script?

I can't re-program the engine, total beginner . . :OO . .

Is there a reason why this should be core and not an add-on in the asset library?

This is better left, to the engine devs, to figure out, was thinking it could work, like the ECTS system, in Unity, that allows 'spawning' of MANY objects, in parallel, or close <3

Thanks . .

jasperbrooks79 commented 3 years ago

now, suppose you have to calculate collision, between 10.000 enemies . . maybe that could be sent to the GPU, and handled there, giving a much larger amount of enemies, on screen . . not sure, one would need a MathGPU visual script, or so on . . then, when the calculations are done, or so, the CPU could take over, in other parts, not sure, thanks . . <3

maybe one could make a physics engine, that runs on the GPU . . other stuff . . <3 but, it'd have the limitations GPUParticles has, over CPU calculations, maybe it's enough, for many use cases, thanks . . .

jasperbrooks79 commented 3 years ago

like, move_and_slideGPU, which can only do the math, the GPU can . . and, maybe a property, so one can set aside, how many GPU threads on use, or say 25 %, so one can still have graphics performance . . not sure, is possible . .

possitively 'butcher', the GPU for game-play, the CPU can do other things, then <3 <3

jasperbrooks79 commented 3 years ago

like, maybe make a RayCastGPU, so if one has an army, of 100.000 units, with collisions ( simplified ) running on the GPU, it could also calculate ' elevation ', so they can move over terrain . .

maybe, the GPU could handle simple collisions, or so . . >>

2021-01-13 1059

not sure, could be Godot's ' new ' physics engine, sigh . . . <3 . .

jasperbrooks79 commented 3 years ago

like, the same way the GPU can run a bunch of shaders, at same time, maybe it could run some physics stuff, also . . . Skærmbillede (886)

it'd only need some special methods, that are specific to that node, like sub - methods, so it's GPU - stuff <3

jasperbrooks79 commented 3 years ago

like, maybe a RayCastGPU could work, by using a texture, as a height - map, and after it has calculated collision, it takes the ' height ' of unit, from the height map, since GPU process textures fast, not sure . .

2021-01-13 1125

then, maybe the CPU could do the last calculations, for finding the exact height, or using, approximations, etc etc . . <3

might be possible, to make an infinite army, at least in low - poly, or stuff like a bomb detonation, that deforms a part, of terrain, and leaves a ' realistic ' crater or, clouds forming, or so, live, not sure <3 Thanks . .

jasperbrooks79 commented 3 years ago

the last part, as SSD's are very fast, might be to be able to write large data amounts to SSD's, so it doesn't tax memory, not sure . . making full use, of the latest tech, to get un-rivalled performance, again, not sure . . <3

use it, as virtual RAM, in an optimized way, or for storing large amounts of data, fast . .

jasperbrooks79 commented 3 years ago

last, calculating stuff like 3D sounds, so AudioStreamGPU, for calculating accurate sound acoustics or, using approximations, might enable like, 1000 people talking, simulated . . <3

jasperbrooks79 commented 3 years ago

last thing is, GPU's are good at calculating light, so on . . those aspects, of the GPU's, might be able to be used, for other calculations, not just texture processing or, loading things super - fast, using special VRAM . . if that GPU memory, could be used for storing or, keeping physics information, it might be VERY fast, or so . . Thanks . . <3 <3

ps. you might have to make a special audio format, that can be processed, on the GPU, or ' make ' sound, and re-produced, so the graphics card, can better calculate it, or so . . . <3

so, same way a shader can calculate many pixels, the graphics card ' audio ' format, could be made, to handle many voices or, more, thanks <3 or, sound bouncing, in rooms . . . :OO <3

jasperbrooks79 commented 3 years ago

last, since many computers use multi-threaded CPU's, maybe the work-load, could be sent there, for optimization . . ie., make full use, of the architecture, this is really wild, hard - core stuff . . :OO

jasperbrooks79 commented 3 years ago

or, multi - core, maybe an engine god or, master could make really good use, of all this stuff, to create a brand new physics and, effects engine . . <3 :OOO . .

jasperbrooks79 commented 3 years ago

maybe, the new voxel terrain editor, could be stored in a 3D texture, or so, and calculated, on GPU . .

2021-01-13 1226

not sure how well, GPU handles 3D textures or, volumetric textures, at all <3

jasperbrooks79 commented 3 years ago

that way, the entire terrain would be a ' shader ', and the CPU could handle tri-mesh collision, alone . . :O

jasperbrooks79 commented 3 years ago

stuff like water, might also be a ' voxel ' river, or wind, could be a ' shader ' :OO . .

may-be . . . 2021-01-13 1232

GPU approximations . . <3 also, wind, hurricanes or, earth - quakes, that deform the pixels, in a GPU terrain shader, not sure . . :OO

the calculations the GPU can't handle, could be semi - handled, when needed, by the GPU . . <3

requires, an engine god or, more . . :O Thanks <3

jasperbrooks79 commented 3 years ago

maybe in a terrain, instead of making a cube, if the terrain is say, 200 meter wide, and tops 20 meter high or, so . . then, the 3D texture could be compressed, to 200 x 20, to save space, or one could use alpha channel, to select parts, not to be calculated, so one ' thread ' could process faster and, be freed, to do other stuff, hard - core optimization, maybe using AI, or like, god - level code, or more <3 Thanks . .

jasperbrooks79 commented 3 years ago

last, since the audio card also has a special processor, for what it does, maybe one could send certain calculations, like an 'audio' shader there, to make it pitch in, for frequency or, wave calculations, that's hard - core . . like, shaders run well, on GPU's, maybe the audio chip-set, could be ' recruited ', to do certain non - audio calculations, maybe in physics, such as wave height, on water - shader or, so . . Thanks . . . <3 <3

one would need to find out, what the audio card is good at, then send details, of calculations there, for 'fast' processing, or so . . a custom ' shading ' language, for the audio card or, more . . that might be the ' missing ' parts, of what the GPU can't do, or so . . .

since the audio card can process many different effects, at the same time, maybe some of those ' processes ' could be used, for other stuff, not sure <3 <3

assuming, that the audio processor is good at certain, specific calculations, like the GPU is <3 and, like, one could send a special format, with stuff to be calculated, frequency stuff, modulation, other stuff, and use that, to run physics or, simulations . . . <3

jasperbrooks79 commented 3 years ago

like, maybe one of the threads in the audio card, could be used, for physics, instead of an ' effect ' . .

2021-01-13 1148

<3

jasperbrooks79 commented 3 years ago

like, for calculating waves on, top of waves or, so . . > 2021-01-13 1150

or, wind bouncing, in rooms or, so, for realistic wind effects <3

jasperbrooks79 commented 3 years ago

here . . 2021-01-13 1251

in theory, it should the same, as adding audio waves and, ' finding ' result <3 . . .

jasperbrooks79 commented 3 years ago

or, rain drops that fall on water, and propagate like waves, etc . . .>>

2021-01-13 1253

I don't know how good current audio chip-sets are, of what they can do . . a single rain-drop calculation could be ' replicated ' and, used again, once the calculations, are done <3 . . :OO . . .

mixing frequencies, is what it's about, or so <3

once you have a ' slice ', you just need to make a bevel, perhaps on the GPU, to create the ' shader ' >> 2021-01-13 1256

I wonder, if one could use that, to simulate physics, or so . . <3 <3

jasperbrooks79 commented 3 years ago

by sending calculations back, and forth between the CPU, GPU and, audio processor chip - set, one could make some cool physics or, simulations . . need to be written, in C# or, GDNative, to run the best . . :OO

and, one would have to optimize system bus usage, to make the most of it, really hard - core, or so . .

jasperbrooks79 commented 3 years ago

an earth - quake, a tsunami or, a massive storm is, also just a 'wave' that propagates . .

like a wave, in the sky . . <3 <3 2021-01-13 1305

it's a stuff, for engine legends ( Juan <3 . . .

jasperbrooks79 commented 3 years ago

rain, that billows in wind, is also a wave or, sine curve, getting mixed . . <3 <3 . . . Thanks . .

the PS5 has a special 3D audio chip, that can parallel process 100 3D audio sources, or so . . modern sound chips, are pretty cool, maybe Sony would get behind developing it, pay for it <3 <3 and, Godot would be supported, on the platform . . :O

one could, write them an e-mail, hear if they like it :OOO . . <3 or, just make it, modern graphics cards are probably pretty good, not sure . . .

also, waving grain, in the winds . . ya ya <3

jasperbrooks79 commented 3 years ago

and, maybe Sony could lend some expert help, with the coding, to create a brand new technology and, as a thank you, make Godot a supported engine, ie. allow export, and code the port, to Playstation <3 <3 . . :OO

jasperbrooks79 commented 3 years ago

it might make Godot the most desired engine, to make next - gen games in, at least on Playstation, except one has to get 'approved' a game, by Sony, to publish it, but AAA studios might like it, that have a ' foot in ' the door, or so <3

also, they may give a nice donation, as thank you . .

jasperbrooks79 commented 3 years ago

also, this could potentially put Playstation miles, ahead of Xbox, where it's lacking a bit, in terra-flops, think 10.2, vs. 12.3, on Xbox, getting the audio card involved, for making physics and, effects, might make it 50 % faster, than Xbox :OO <3 <3

jasperbrooks79 commented 3 years ago

also, there could be a deal, where all companies wanting to use this ' audio shader ' tech . . would be asked to use Godot, for their game projects, as thank you . . <3 then, you're a house-hold name, in 1 - 2 years, globally <3 <3 . . . .

and, they'd probably want to say thank you, also, with a few meager donations . . <3

jasperbrooks79 commented 3 years ago

for instance, the explosions inside the building, might be calculated as 3D sound, bouncing in the rooms, then send the physics calculations, to the GPU or, some part, of the CPU <3

2021-01-06 1612

or, maybe this could be handled, in part, by the audio multi-thread processor . . :OO

2021-01-06 1613

have to be heavily optimized, Sony could maybe be interested in this, and take Godot's open source code, and use it to build their in-house dev kit . . <3 <3 :OO . .

even simulate, the waves, on the waves, or so . . :OO . . . <3

plus, as a thank you, Sony might start sending some free code, for the Godot engine and, when Juan retires, he could get a nice job, for Sony, if he wanted . . <3 <3

unless, he wants to go down, as an open source hero, or so <3 ya ya . . .

also, when the amplitude hits a certain height, then apply foam, using the GPU <3

jasperbrooks79 commented 3 years ago

last thing is, I heard what makes SSD fast, is that it can read a lot of things, in parellel, same way GPU makes calculations, in parallel, so it might be possible to recruit the SSD, as the last piece, of making ' shaders ' run fast, as virtual memory, or a place to store and, retrieve a ton of information, in parallel . . .

Calinou commented 2 years ago

Closing due to lack of support.

Also, this can already be achieved with GPUParticles3D/2D nodes, including with manual emission from script. Note that if you only intend to spawn a few dozen objects per second, it's probably not worth using a GPU-based system.