High Definition Dynamic Shadows..

Ask questions, discuss ideas, get answers
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

High Definition Dynamic Shadows..

Post by fo0k »

So I noticed yesterday that grenades amongst other things have very high def dynamic shadows.
When looking at the model of the grenade it does not have a shadow mesh.. so it is created in the same way as the player model just using the main mesh.. (almost..)
the grenade for example has a seperate 'Shad' mesh which Im presuming is used for the shadow gen. Never seen this before and have tried a little to get this HD shadow working on a willy.. but no luck yet. had a bit of a chat with Senshi on it and tried to emulate the grenade basic setup. this would be really nice to have some high qual dynamic shadows on all pco's etc..
maybe has something to do with being an animated object.. dunno..

anyone get this working on a car? :)

Look! ;)

Image
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: High Definition Dynamic Shadows..

Post by Apache Thunder »

Could be the projetile class that determines this. I'm pretty sure that granade doesn't use an animated mesh. Plus animated mesh shadows aren't much more detailed then normal shadows. The shadow mesh for the banana projectile in my mario kart mod for example doesn't have a high def shadow like shown in that screenshot. The banana projectile uses an animated mesh for a shadow since it has some animations so it

Also perhaps it's because of the distance of the granade from the ground?

This sounds like a stretch, but you can try changing the detail level of the ground hieghtmap. Perhaps make a higher res heightmap file (the game does support larger hieghtmap images). Make it something really large like 4096x4096. Don't change the size in the terrain con file. Just the heightmap file. It shouldn't result in a change in the heightmap's detail ingame, but it could increase shadow detail perhaps? It probably casts a show onto the hightmap image and since that image is always really tiny, the shadow is all pixalated. Also try a hieghtmap size that is a double of 4096x4096. That is the combined resulution of all the ground textures when they are stitched together.

Also note that BF2 hightmaps are usualy double the res of a BFV/BF42 hightmap and the shadow meshes in BF2 are higher detailed. ;)

EDIT: lol try to avoid using 8196x8196 sized hightmaps...the result is a 128mb sized raw file. :P

EDIT: Dam can't seem to resize it above 2048 without BF42 puking all over it. :(
ImageImageImage
I have cameras in your head!
User avatar
Senshi
Posts: 697
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany
Contact:

Re: High Definition Dynamic Shadows..

Post by Senshi »

Checked today. Shadow quality is hardcoded, but differently so for each type of objects. Projectiles get HD shadows, soldiers and PCOs don't.

Easy to verify: Just check the exppack and the landmine, they get HD shadows too when dropped.

High res heightmaps don't solve this issue, I'm afraid. At least I never noticed. Any I had quite some Ultra-HD-terrain projects (file size was something over 600MB for a city-sized map ;) ), never noticed a change in shadows.

Sadly, we'd require source code access to change the shadow generation quality. I'm sure it's quite easy to change this, IF we had this. Probably just some numbers.... :(
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: High Definition Dynamic Shadows..

Post by fo0k »

We can't trick the engine into thinking a car is a projectile?
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: High Definition Dynamic Shadows..

Post by Apache Thunder »

Well you addTemplate whatever you want onto a projectile, but as soon as you addTemplate something with collision physics onto a projectile the game will CTD. :(

Perhaps try addTemplating a projectile to the main PCO and use it to make the shadow mesh?

Much like how I addTemplate a turret shadow object to add shadow to turrets. ;)
ImageImageImage
I have cameras in your head!
User avatar
Senshi
Posts: 697
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany
Contact:

Re: High Definition Dynamic Shadows..

Post by Senshi »

That would be the only way I can think of. But how would you attach a projectile to a PCO? I thought you can't spawn/addtemplate projectils, only "fire" them.
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: High Definition Dynamic Shadows..

Post by Apache Thunder »

True you can only fire them. But perhaps when addTemplated to vehicles they won't be visible, but their shadow might be active. Just a thought. I'll give it a shot and see if I can get it to work. ;)

EDIT:

Dam didn't seem to work. :(
ImageImageImage
I have cameras in your head!
User avatar
Senshi
Posts: 697
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany
Contact:

Re: High Definition Dynamic Shadows..

Post by Senshi »

How do you want to make the projectile being attached to the vehicle after it's been fired? As simple attaching doesn't work, that would be the question which would need solving...but I doubt there's anything like that in BF42. Perhaps in BFV one could use the sticky code, but for BF42 I don't think something comparable exists.
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: High Definition Dynamic Shadows..

Post by Apache Thunder »

Well initial tests revealed that the sticky code works in BF42 as long as the projectile does not have network info. Since other wise it would CTD if the owner died before the projectile did or if the vehicle died before the projectile. This also would occur when a round ends. But when I removed network info form the exppack for example, I was able to stick it to vehicles, die or restart the round without a CTD. Was also able to kill vehicles with the exppack on it still and no CTD. But the big draw back is that the detonator does not work if the exppack has no network info. :(

Might be usefull for landmines though. ;)

Too bad the C4 needs network info if you want to beable to detonate it with the detonator. :(

Also note that if you remove network info from the landmine for example, it would allow the player to place as many landmines as they want without any dissappearing. Remming out network info from landmines or Expack serverside makes them invisible client side. Something that the invisible command can not achieve I believe. ;)
ImageImageImage
I have cameras in your head!
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: High Definition Dynamic Shadows..

Post by fo0k »

was hexing my way around the bf1942.exe just now and noticed seeming support for self shadowing shadows..
edit: this was for raytracing for terrain shadows so nvm :/

but..

ObjectTemplate.minNrToTakeControl

Never seen this before i dont think.. sounds interesting for flags..
Post Reply