Geti wrote:
the bigger issue is how to get it to check all those collisions and make/remove internal pressure softbodies and decide when to split and whatever without a huge lag spike. what you've just described is possibly more lagging than doing it per-pixel. the documentation doesnt cover much of what you'd need anyway, and WE HAVE NO DRAWING FUNCTIONS.
so basically, we could show it as points at best, unless theres a way to dynamically shift a texture over a constantly redefined polygon?
I Didn't think we had drawing functions, but if say, data added them.... you get the idea.
I also would suggest using the same mat textures we have now, and just control the alpha for pressure.
kotsoft wrote:
i have tried coding water as deformable objects before. to make it incompressible, each step, you would get the area of the polygon, and then shift points outward to make it keep the same area. to get surface tension, you can have a small force that moves the two points of each edge together. this force combined with the area preserving force makes surface tension. the area preserving force also takes care of waves. then one last step to make the water infinitely deformable would be to insert points where edges get too long. the steps so far are very fast and simple, but that's the end of the easy part. this works for simple cases, but once you have complex scenarios there's all kinds of things you have to check for, like self collisions, and merging with other bodies, and splitting bodies of water. and those things make it basically just as slow as a well optimized particle based simulation. also, this only simulates from the surface, so you're missing all the vortices and turbulence stuff that happen in the middle.
If you had read my posts, you would see it can handle vortexes. here, allow me to explain how this would work step by step.
Any material can be a soft body, from metal, to soft dirt, to jello, to water, to air, to ligher-than-air gas.
*Start as a single, area (defined by corners, at any angles, to form a closed space)
*Designate how dense by volume the area is. At first it will be uniform
--Start
1*Calculate forces exerted upon 'self' by 'self', generating internal and external deformations from imbalance
2*calculate pressure changes from above forces, generating high and low pressure areas as 'deformations'
3*check for collisions
4* If in a collision, define area to check for changes from collision.
5* Calculate forces from collision, in the area defined in the above step,
6* repeat step 2 for step 5 rather than 1
7* do steps 4-6 for all collisions
8* next frame, do 1-8
--Because high pressure will push on low pressure, Low pressure and high pressure will cycle, as high and low pressure areas, IE vortexes inside the closed body, which can have direct effect on the surface. Density by volume will handle surface tension in different areas, and if it is not in a closed space, the pressure differences will put (heavy on top, zero density on sides) and thus, it will "expand out the bottom" which in English means, IT SPILLS! IT FLOWS!
as a solid, obviously, the object will be dense and stable enough, to support its own weight, unlike water or air, although additional weight, or being beyond its ability can bend, or warp a harder object.
Also volumetric explosions work as telling a soft bodied object that it has 110000 atoms per pixel, and that it is in low pressure, at 0 atoms per pixel, and must expand to equilibrium. the result, Expansion along paths of least resistance until well, equal pressure. In an enclosed environment, this would certainly crush other soft bodies like actors, but if its closed space, has an opening, it would also attempt to pull everything out the opening. See: Rapid decompression.
This method would realistically handle all of these situations, using the exact same method. and as for calculating complex multi-area objects, look at most games in 3d.
Lets use Every FPS as an example
If you shoot someone in the foot it does less damage, than if you shoot them in the knee.
If you shoot them in the chest, it does more than if you shoot them in the knee.
If you shoot them in the head, they just die. usually.
How? Different parts of the 3d objects are different areas.
In Halo 2, there are over 20 different parts of a body, that take different amounts of damage. Sure, they just set the damage to be the same across the board for most of them, but they had to define them independently because the parts of the body move differently.
If they can define both location IN 3D and how much damage taken per weapon,
Then we can define in 2d, Material ID and Pressure, for that many or more areas.
Also, a Well cleaned up and streamlined physics engine with compiled code, will ALWAYS run faster than some crudely made java applet, even if the compiled one uses MORE COMPLEX PHYSICS.
The reason I'm pointing this out, because if after CC is finished, data feels up to a bigger project, he could potentially do, i dunno, CC2. it could use volumetric based physics, in 3d. we'd probably be able to still run it as is, after all
it would use 3d video cards. Even if it wasn't 3d, it could potentially load faster if it was compiled properly.
But mostly, because if Data sees this and likes it, he might include it himself. It would have to have very limited use, such as for specifically water, experimental deformable materials, or for explosives.
IE We couldn't replace ALL MOSRs with it, because well... MOSRs lag enough as is, and this would add variables to it! It would be very limited use indeed. I admit, this is an idea for next-gen consoles, not home PCs... Bad idea on my part to post it expecting a positive response here.