June 20, 2019, 09:25:15 AM

Author Topic: Universal 1st/3rd pers. AGK Framework( - physics) WIP  (Read 5258 times)

Online Steve Elliott

  • Hero Member
  • *****
  • Posts: 1802
Re: Universal 1st/3rd person AGK framework(without physics)
« Reply #45 on: December 11, 2018, 04:31:47 PM »
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?
Windows 10, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
MacOS Mojave, 64-bit, 8Gb RAM, CPU Intel i5, 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB.
Linux Mint 19.1, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).

Offline RemiD

  • Hero Member
  • *****
  • Posts: 805
Re: Universal 1st/3rd person AGK framework(without physics)
« Reply #46 on: December 11, 2018, 04:41:05 PM »
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.
DualCore AMD E-450, 1646 MHz - 6 Go DDR3 1333 SDRAM - AMD Radeon HD 6320 Graphics (384 Mo) - Windows 7 Home Premium - DirectX 11.0

Offline Rick Nasher

  • Hero Member
  • *****
  • Posts: 708
Re: Universal 1st/3rd person AGK framework(without physics)
« Reply #47 on: December 11, 2018, 05:09:15 PM »
@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
_______________________________________

Offline blinkok

  • Jr. Member
  • **
  • Posts: 98
Re: Universal 1st/3rd person AGK framework(without physics)
« Reply #48 on: December 11, 2018, 07:41:45 PM »
Have you tried SetShadowBias( bias )?

Offline Qube

  • Administrator
  • Hero Member
  • *****
  • Posts: 1902
Re: Universal 1st/3rd person AGK framework(without physics)
« Reply #49 on: December 11, 2018, 08:48:29 PM »
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
Until the next time...

Offline RemiD

  • Hero Member
  • *****
  • Posts: 805
Re: Universal 1st/3rd person AGK framework(without physics)
« Reply #50 on: December 11, 2018, 09:07:54 PM »
so... when you remove all the unfinished / buggy / poorly documented features of AGK, what remains seems not much :))
DualCore AMD E-450, 1646 MHz - 6 Go DDR3 1333 SDRAM - AMD Radeon HD 6320 Graphics (384 Mo) - Windows 7 Home Premium - DirectX 11.0

Offline Qube

  • Administrator
  • Hero Member
  • *****
  • Posts: 1902
Re: Universal 1st/3rd person AGK framework(without physics)
« Reply #51 on: December 11, 2018, 09:36:59 PM »
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.
Until the next time...

Offline GaborD

  • Sr. Member
  • ****
  • Posts: 284
Re: Universal 1st/3rd person AGK framework(without physics)
« Reply #52 on: December 11, 2018, 09:49:35 PM »
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.

Online Steve Elliott

  • Hero Member
  • *****
  • Posts: 1802
Re: Universal 1st/3rd person AGK framework(without physics)
« Reply #53 on: December 11, 2018, 09:50:04 PM »
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.
Windows 10, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
MacOS Mojave, 64-bit, 8Gb RAM, CPU Intel i5, 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB.
Linux Mint 19.1, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).

Offline Rick Nasher

  • Hero Member
  • *****
  • Posts: 708
Re: Universal 1st/3rd person AGK framework(without physics)
« Reply #54 on: December 12, 2018, 10:04:23 AM »
Got an answer from AGK's Paul Johnston:

Quote
Mode 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
_______________________________________

Offline Holzchopf

  • Full Member
  • ***
  • Posts: 139
Re: Universal 1st/3rd person AGK framework(without physics)
« Reply #55 on: December 12, 2018, 10:16:25 AM »
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?

Offline Rick Nasher

  • Hero Member
  • *****
  • Posts: 708
Re: Universal 1st/3rd person AGK framework(without physics)
« Reply #56 on: December 12, 2018, 10:50:17 AM »
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
_______________________________________

Offline GaborD

  • Sr. Member
  • ****
  • Posts: 284
Re: Universal 1st/3rd person AGK framework(without physics)
« Reply #57 on: December 12, 2018, 04:52:45 PM »
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.

Offline blinkok

  • Jr. Member
  • **
  • Posts: 98
Re: Universal 1st/3rd person AGK framework(without physics)
« Reply #58 on: December 12, 2018, 11:46:38 PM »
Is the code in the first post still the latest?

Offline Holzchopf

  • Full Member
  • ***
  • Posts: 139
Re: Universal 1st/3rd person AGK framework(without physics)
« Reply #59 on: December 13, 2018, 06:30:14 AM »
In real life we basically have infinite shadowmap resolution, in 3D not so much.

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