Universal 1st/3rd pers. AGK Framework( - physics) WIP

Started by Rick Nasher, September 24, 2017, 19:26:37

Previous topic - Next topic

Steve Elliott

Quote
- Appears shadows are displaced more in mode 2 then in mode 1, while none occurs in mode 3(slowest).

So you don't get a problem with mode 3?  Just that the other modes have made a compromise in accuracy to gain some extra speed?
Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

RemiD

so your characters are always on the ground, but depending on the shadows mode, it makes it looks like they are not (because of the shadows offsets)...

the offset depending on the angle of view / caster is similar to what i have noticed with swift shadow system (for Blitz3d)...

A way to prevent the offset was to make the shape go slightly through the floor.

Rick Nasher

@Steve Elliott
Exactly. However, if so should be fixable by adjusting the shadow offset in conjunction to the cam, but that would require access to the engine I guess.

@RemiD
Yeah I've tried that and works but interferes with collision system, would be a workaround and would have to do it for all objects which is a bit silly and make things overly complicated. Besides I think should be fixable by what I mention above.

_______________________________________
B3D + physics + shaders + X-platform = AGK!
:D ..ALIENBREED *LIVES* (thanks to Qube).. :D
_______________________________________

blinkok


Qube

Quote- Appears shadows are displaced more in mode 2 then in mode 1, while none occurs in mode 3(slowest).
Shadows in AGK are not the best in either quality or features. If I remember the angle is based on the sun and that's pretty much it. I hope they update the shadow side and it needs a little love.

Quote(Hope it's not killing bandwidth Qube)
Nah, it's OK. I pay for their truly unlimited service and they've not complained once yet :P
Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

RemiD

so... when you remove all the unfinished / buggy / poorly documented features of AGK, what remains seems not much :))

Qube

Quote from: RemiD on December 11, 2018, 21:07:54
so... when you remove all the unfinished / buggy / poorly documented features of AGK, what remains seems not much :))
Lol, it's not that bad :P - It's very feature rich for the price and it's documentation is 100 times better than later BRL products. The downside is that not all features are fully fleshed out like physics, shadows, 3D models / texturing / animation. It could do with better implementations in parts. Overall I still like it a lot but you have to workaround it's limitations just like anything else.
Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

GaborD

For me personally, the only thing that matters is that the foundation is solid, fast and flexible.
In my opinion you have to write the higher level systems (including rendering and the shaders) specifically for each type of project anyway, no matter the language/engine. Because that's the only way to high rendering quality with good performance.

Steve Elliott

Quote
so... when you remove all the unfinished / buggy / poorly documented features of AGK, what remains seems not much :))

lol like BRL ever produced good documentation and added shaders!  I would say it's very good for 2D.  3D is buggy, but at least they bothered to try to add features, unlike Blitz 3D.
Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

Rick Nasher

Got an answer from AGK's Paul Johnston:

QuoteMode 2 uses some funky perspective projection matrices that get incredibly inaccurate when the camera and light are pointing in the same direction. The only things I can think of to work around it is to limit the extent of the projection matrix by using SetShadowRange to set the range smaller than the camera view range, or switch to mode 1 when the dot product of the light direction and the camera direction reaches a certain value. i.e. (Lx*Cx + Ly*Cy + Lz*Cz) > 0.7 where (Lx,Ly,Lz) and (Cx,Cy,Cz) are normalized, and 0.7 is a value between 0 and 1, where 1 is looking in exactly the same direction and 0 is perpendicular to each other.

The first suggestion has already been implemented and didn't do much, only effective when drastically reducing.
I'm actually really pushing the system though for using a very large scale to stay compatible with the physics system.

The 2nd suggestion might work but at a cost of accuracy.
I'd prefer to have a command to shift the entire shadow texture as happens to all objects at same time.

But dunno if that's actually feasible, so I asked.
_______________________________________
B3D + physics + shaders + X-platform = AGK!
:D ..ALIENBREED *LIVES* (thanks to Qube).. :D
_______________________________________

Holzchopf

I'm no expert in 3D, not even a manager in that field, but I can't resist asking this dumb question: Why should shadows depend on camera direction? They don't in real life, so why do they in AGK?

Rick Nasher

Afaik: Shadows depend on sun(lightsource) position and the cam position/angle in order to represent them.
In an ideal world shouldn't matter, but it's a sim, not the real world.
Would otherwise probably be too FPS intense.

In mode 3 all is fine btw but it's bit more costly on FPS and as I'm on an old rig.. all bits matter.
_______________________________________
B3D + physics + shaders + X-platform = AGK!
:D ..ALIENBREED *LIVES* (thanks to Qube).. :D
_______________________________________

GaborD

Quote from: Holzchopf on December 12, 2018, 10:16:25
I'm no expert in 3D, not even a manager in that field, but I can't resist asking this dumb question: Why should shadows depend on camera direction? They don't in real life, so why do they in AGK?

Not a dumb question at all. You are right about real life, shadows don't care which direction or distance you look at them from.
In real life we basically have infinite shadowmap resolution, in 3D not so much.

What Rick said hits the nail on the head, in 3D resources are very limited and have to be optimized for speed.
Some trickery is necessary to have reasonable shadow resolution near the cam while still covering a big area.

blinkok


Holzchopf

Quote from: GaborD on December 12, 2018, 16:52:45In real life we basically have infinite shadowmap resolution, in 3D not so much.

Didn't think about that. Thanks for pointing that out!