SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SHIII Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 02-19-09, 10:44 PM   #76
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by skwasjer
Erm, RB, there's dozens of objects in the game with only a single plane, like airplane props, flags, railings, trees, glass, wires, chains etc. So how do you think they are rendered? Right, with cull none... (aka 2-sided).

Every material has the option to specify culling (ccw vs none to be exact). Time to download S3D me thinks...
You are correct about the 2-sided BUT that doesn't seem to apply when it comes to shadows. It doesn't take that into account. I specify two-sided and it still gets culled. I even tried the map from a ship (subset #3) which gave the texturing for the handrails (which is 2-sided) and that didn't even work. It simply ignores 2-sided when doing shadows. I'm forced to fill the backfaces.
TheDarkWraith is offline   Reply With Quote
Old 02-19-09, 10:53 PM   #77
flakmonkey
Grey Wolf
 
Join Date: Jul 2006
Location: Staffordshire, Uk
Posts: 944
Downloads: 78
Uploads: 0


Default

Im assuming that the turm shadows are cast from whatever 3d object is within SHD_xxxx.obj (or something like that) inside the turm.dat file.

If this is the case then why not just duplicate the turm model and invert its surface normals within a 3d app, meaning youll have 2 turm models occupying the same space in a single .obj file but one with outward facing normals and one with inward facing ones.

Ok its not perfect and will double the polycount for the shadow casting model but i see no reason why it wont work.

Having done a couple of models for sh3 in the past i found this was the easiest way to get a "double sided" surface. + i really wish id known about s3d back then!
__________________
flakmonkey is offline   Reply With Quote
Old 02-19-09, 11:10 PM   #78
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by flakmonkey
Im assuming that the turm shadows are cast from whatever 3d object is within SHD_xxxx.obj (or something like that) inside the turm.dat file.

If this is the case then why not just duplicate the turm model and invert its surface normals within a 3d app, meaning youll have 2 turm models occupying the same space in a single .obj file but one with outward facing normals and one with inward facing ones.

Ok its not perfect and will double the polycount for the shadow casting model but i see no reason why it wont work.

Having done a couple of models for sh3 in the past i found this was the easiest way to get a "double sided" surface. + i really wish id known about s3d back then!
I will try that and let you know how it works. Thanks

EDIT: beautiful idea FlakMonkey. These Turm shadows are believable and looking good. I'll need to add the interior Turm to it tomorrow to get the correct shadow but we have a solution!
in this one the shadow has a nice straight solid edge on the back of the Turm just like it should be considering the sun is shining from the upper left corner of the screenie:


and here the sun is aft and just to the left of the Turm. Note the solid shadow:

Last edited by TheDarkWraith; 02-20-09 at 12:36 AM.
TheDarkWraith is offline   Reply With Quote
Old 02-20-09, 01:18 AM   #79
tonschk
Admiral
 
Join Date: Mar 2007
Posts: 2,200
Downloads: 172
Uploads: 0
Default

This is Beautyful Wonderful Awesome Amazing Congratulations Racerboy
__________________
What we do in life echoes in Eternity
tonschk is offline   Reply With Quote
Old 02-20-09, 02:37 AM   #80
rascal101
Grey Wolf
 
Join Date: Jun 2006
Posts: 769
Downloads: 200
Uploads: 0
Default

Well now the plot thickens - I tried this following the steps as written - and I too got shadows! YAY! - but - we're not out of the, shadows yet - look closely at the screenies below see the emerald green flash on the guy left hand middle on the conning tower, and the dark pink smudge on the back of the guy opposite, that's actually a mirror image of someones binoculars, the guy opposite him perhaps - but the shadow in this case is flashing disco colours

For some funny reason this thing does work - but only kind of - I got great shadows all over the sub where I'd expect to find them, round the gun, also the gaurd wires etc - but I also got this weird ranbow flashing around crew faces, hands and binoculars

The rest of the sub looks ok except at certain angles, mostly from behind and above - the side of the conning tower becomes transparent and you can see though it to the side of the sub in the water.

In port I went to take a look see how other objects were affected - again overall some nice shadows - but on closer inspection some solid serfaces are now renedered transparent, some transparent are now solid. etc and there is some flashing.

I think we are on the right track but worry that if we are using a file from the first release of the game it is trying to render surfaces that have been altered in sucessive mods - while for the most part it does what its supposed to do, it kind of falls away on some small details ie like crew hands, binoculars etc

Over to you - the experts - this is the first time I've actually got in there and fiddled with stuff, is great but this needs some more work I think

Rascal

Quote:
Originally Posted by IFRT-WHUFC
Quote:
Originally Posted by Racerboy
Quote:
Originally Posted by rascal101
Just to clarify before fiddling with any config files myself - can you guys tell me / us if you are intending to release this as a fully fledged mod to be installed via JSME - or would you advise the rest of us to follow your advise re your latest edits to the config and other files.

If the latter - could you set out a simple step by step instruction so those if us with less expertise can follow and install this.

I am assuming this will work with GWX3.0 etc Hoping you can confirm

Rascal

PS RACERBOY - any interest in working on lighting, surface glare and reflection - my experience at sea is that commercial ships are painted in gloss paint as is more impervious to rust - is intersting that all painted surfaces on all ships in SH3 have a matt finish so they dont look right - any thoughts
Specular and glossiness in SH3 are what you are wanting to play with. The specular strength will determine the 'sharpness' of the specular.

If you follow what I posted just a few posts back and follow what FlakMonkey said and use the SH3Controllers.ACT file FlakMonkey has posted you can start having shadows now (for those objects correctly setup)!

VIIb Turm shadows coming along nicely:


You all be sure to thank Privateer for this. Since he decided to hold back his findings from everyone except one (which pissed me off royally) that was the drive I needed to figure this out. I do thank him for at least showing it was possible and that he had found a way to make it work (which until he says we'll never know how he did it). I wouldn't have ever given shadows another go if otherwise. What happened to you Privateer? That's not the person I knew at one time.

EDIT: got the periscopes shadowing BUT there's a backface problem with Turm shadows. The 3D model used for Turm shadows needs it's backfaces 'filled'. Does anyone know how to add backfaces using Wings3D or Misfit3Dmodeller?? See below the problem with the open Turm shadow:


I'll work on trying to resolve the flourescent colors with the watchmen. It's a lighting problem caused by the DynamicShadow light source.

In the mean time here's another demo. This playable demo gives all the features in the above screenie. Same thing, extract to MODS folder, run the single mission 'SHD_testing'
Alright now rapidshare is pissing me off....it's says only 10 people can download this again...what gives?
http://rapidshare.com/files/20019523...sting.zip.html
That pic' looks great to me, the light source should be the sunlight and both periscopes are casting a shadow in the same direction!

Great Work as Usual RB!!
rascal101 is offline   Reply With Quote
Old 02-20-09, 03:31 AM   #81
JScones
Navy Seal
 
Join Date: Apr 2005
Posts: 5,501
Downloads: 19
Uploads: 0
Default

Quote:
Originally Posted by bigboywooly
Dont think Privateer is a member here any more
Don't tell me he had a "silly little twit fit" and left "in a pout"???

:rotfl:

On topic though, it's amazing how little things like shadows really make a difference.

And it's great to see the advantages of open development in action. Nice work RB and Flakmonkey (and anyone else that's contributed).

Looks like there is still a bit of work to do (crew shadows and the like), but it's looking nice so far.
JScones is offline   Reply With Quote
Old 02-20-09, 04:57 AM   #82
flakmonkey
Grey Wolf
 
Join Date: Jul 2006
Location: Staffordshire, Uk
Posts: 944
Downloads: 78
Uploads: 0


Default

A couple of interesting things ive noticed while playing around with these shadows,

first, ive been on a quick trip to the museum and it seems that pretty much all stock surface units are already perfectly set up for shadows, sadly almost none of the usermade ships/subs work correctly with dynamic shadows.




Second, the sh3 devs obviously did put some thought into their shadow system as there is a nice fade in/out with distance, so even in convoys you should still get a reasonable framerate as only those ships within a certain range will be shadowed (looks to be around 500m).

rascal101: most of the errors you mention are known about and are there because dynamic shadows were never fully implemented by the original devs, this is why RB is going through 1 object at a time starting with the viib player sub, pretty much picking up where the devs left off.
You do seem to have a few new bugs i cant recreate though, this transparency and flashing on surfaces you mention, maybe its just a quirk of your particular gfx card??
+ive looked around the harbours too and there seem to be no shadows on the harbourkit objects at all (transparent or otherwise) excpet those cast by docked ships so im unsure what could be causing the problems you experienced.
Its still early days, ive no doubt all this will be sorted in time.
__________________

Last edited by flakmonkey; 02-20-09 at 05:18 AM.
flakmonkey is offline   Reply With Quote
Old 02-20-09, 05:42 AM   #83
rascal101
Grey Wolf
 
Join Date: Jun 2006
Posts: 769
Downloads: 200
Uploads: 0
Default

Thanks to you hat you should bother to reply to my small efforts - I recon this is going to be licked but by you guys with way more experience than me - Personally I hope you will release it as a fully fledged mod installable via JSME - when its ready of course - nice and encouraging shots of the merchant fleet


Quote:
Originally Posted by flakmonkey
A couple of interesting things ive noticed while playing around with these shadows,

first, ive been on a quick trip to the museum and it seems that pretty much all stock surface units are already perfectly set up for shadows, sadly almost none of the usermade ships/subs work correctly with dynamic shadows.




Second, the sh3 devs obviously did put some thought into their shadow system as there is a nice fade in/out with distance, so even in convoys you should still get a reasonable framerate as only those ships within a certain range will be shadowed (looks to be around 500m).

rascal101: most of the errors you mention are known about and are there because dynamic shadows were never fully implemented by the original devs, this is why RB is going through 1 object at a time starting with the viib player sub, pretty much picking up where the devs left off.
You do seem to have a few new bugs i cant recreate though, this transparency and flashing on surfaces you mention, maybe its just a quirk of your particular gfx card??
+ive looked around the harbours too and there seem to be no shadows on the harbourkit objects at all (transparent or otherwise) excpet those cast by docked ships so im unsure what could be causing the problems you experienced.
Its still early days, ive no doubt all this will be sorted in time.
rascal101 is offline   Reply With Quote
Old 02-20-09, 05:47 AM   #84
rascal101
Grey Wolf
 
Join Date: Jun 2006
Posts: 769
Downloads: 200
Uploads: 0
Default

Hi Racerboy - thanks for the tip I shall leave you guys to work on the shadows while I go mess with gloss - one thing - and without wishing to appear a bit dense - can you tell me where to look for

'Specular and glossiness in SH3 are what you are wanting to play with. The specular strength will determine the 'sharpness' of the specular'


Quote:
Originally Posted by Racerboy
Quote:
Originally Posted by rascal101
Just to clarify before fiddling with any config files myself - can you guys tell me / us if you are intending to release this as a fully fledged mod to be installed via JSME - or would you advise the rest of us to follow your advise re your latest edits to the config and other files.

If the latter - could you set out a simple step by step instruction so those if us with less expertise can follow and install this.

I am assuming this will work with GWX3.0 etc Hoping you can confirm

Rascal

PS RACERBOY - any interest in working on lighting, surface glare and reflection - my experience at sea is that commercial ships are painted in gloss paint as is more impervious to rust - is intersting that all painted surfaces on all ships in SH3 have a matt finish so they dont look right - any thoughts
Specular and glossiness in SH3 are what you are wanting to play with. The specular strength will determine the 'sharpness' of the specular.

If you follow what I posted just a few posts back and follow what FlakMonkey said and use the SH3Controllers.ACT file FlakMonkey has posted you can start having shadows now (for those objects correctly setup)!

VIIb Turm shadows coming along nicely:


You all be sure to thank Privateer for this. Since he decided to hold back his findings from everyone except one (which pissed me off royally) that was the drive I needed to figure this out. I do thank him for at least showing it was possible and that he had found a way to make it work (which until he says we'll never know how he did it). I wouldn't have ever given shadows another go if otherwise. What happened to you Privateer? That's not the person I knew at one time.

EDIT: got the periscopes shadowing BUT there's a backface problem with Turm shadows. The 3D model used for Turm shadows needs it's backfaces 'filled'. Does anyone know how to add backfaces using Wings3D or Misfit3Dmodeller?? See below the problem with the open Turm shadow:


I'll work on trying to resolve the flourescent colors with the watchmen. It's a lighting problem caused by the DynamicShadow light source.

In the mean time here's another demo. This playable demo gives all the features in the above screenie. Same thing, extract to MODS folder, run the single mission 'SHD_testing'
Alright now rapidshare is pissing me off....it's says only 10 people can download this again...what gives?
http://rapidshare.com/files/20019523...sting.zip.html
rascal101 is offline   Reply With Quote
Old 02-20-09, 06:17 AM   #85
IFRT-WHUFC
Engineer
 
Join Date: Jul 2006
Location: By the Nordsee
Posts: 200
Downloads: 374
Uploads: 0
Default

So if you create a backface for the crew models will this fix the bug with lights shining through heads?

Rick
IFRT-WHUFC is offline   Reply With Quote
Old 02-20-09, 07:14 AM   #86
rascal101
Grey Wolf
 
Join Date: Jun 2006
Posts: 769
Downloads: 200
Uploads: 0
Default

Another thing I noticed when I returned to normal and switched off dynamic shadows thinking it better to wait until a proper mod is released - I discovered my smoke effects have gone astray now I get white smoke in large square blocks -

Have decided to do a clean install - yet again - will await for proper mod

Rascal
rascal101 is offline   Reply With Quote
Old 02-20-09, 08:52 AM   #87
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by rascal101
Well now the plot thickens - I tried this following the steps as written - and I too got shadows! YAY! - but - we're not out of the, shadows yet - look closely at the screenies below see the emerald green flash on the guy left hand middle on the conning tower, and the dark pink smudge on the back of the guy opposite, that's actually a mirror image of someones binoculars, the guy opposite him perhaps - but the shadow in this case is flashing disco colours

Yes this is a problem caused by the light source used to make the shadows. It is interacting with the ConfigureBumpMap controller used on the watchmen. I'll be looking into this today.

For some funny reason this thing does work - but only kind of - I got great shadows all over the sub where I'd expect to find them, round the gun, also the gaurd wires etc - but I also got this weird ranbow flashing around crew faces, hands and binoculars

Same as above

The rest of the sub looks ok except at certain angles, mostly from behind and above - the side of the conning tower becomes transparent and you can see though it to the side of the sub in the water.

Backface culling problem. I'm having to fill backfaces on many objects to get rid of this 'see through'.

In port I went to take a look see how other objects were affected - again overall some nice shadows - but on closer inspection some solid serfaces are now renedered transparent, some transparent are now solid. etc and there is some flashing.

Backface culling problem. Fill backfaces and solid objects stay solid.

I think we are on the right track but worry that if we are using a file from the first release of the game it is trying to render surfaces that have been altered in sucessive mods - while for the most part it does what its supposed to do, it kind of falls away on some small details ie like crew hands, binoculars etc

SH3Controllers.ACT v1.0 compares almost identical to 1.4b version except for missing the shadows part.
see above in yellow.
TheDarkWraith is offline   Reply With Quote
Old 02-20-09, 11:44 AM   #88
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,547
Downloads: 26
Uploads: 3
Default

By the looks of it, the problem is not so much culling directly, but the fact that the engine switches between render modes (first render object the to main surface using material specified zbuffer mode, then render to stencil buffer (for shadows) using zbuffer write disabled), but afterwards the device state is not reset correctly, meaning the next object in the render pipeline now gets drawn with zbuffer write disabled, making it act as if inverted/flipped/incorrectly clipped (whatever you want to call it). It looks like this anyway, but I could be wrong.

Therefor I suspect that if you find a way around this (iow. push all shadow related stuff down the render queue) the problem will most likely be gone, without the need for backfaces. Adding backfaces to all models adds unneccesary overhead... Perhaps the ordering of chunks may make a difference, like moving all SHD type stuff down the 'index' list, after the last actual visual object. Another solution could be disconnecting all SHD chunks and building their own dedicated tree after the root node of the DAT, basically a clone. There could be problems here though with animations and other controllers that interact with the positioning of the object, and likely more difficult to maintain but hey... just an idea.

PS: I'd like to add that using a 1.0 controller library is not recommended and a disclaimer should note that bugs could be introduced that possible have been fixed by Ubi in subsequent patches. This particular ACT-file is responsible for many different controller, 50+ of them. Something to keep in mind.
skwasjer is offline   Reply With Quote
Old 02-20-09, 12:16 PM   #89
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Good idea. I'll try moving all the SHD related items towards the end of the file and see what happens

Edit: didn't work. I was hopeful. This really bugs me. If you look at these screenshots you'll see the problem I'm having now. All I did was enable interior Turm shadows from the demo posted. You'll see great interior shadows BUT it totally screws up the shadows cast onto the sub by the Turm:




And here's the problem enabling these interior shadows creates:


Filling in the backfaces of the interior Turm has no effect whereas filling in the backfaces of the Turm gave the great Turm shadow. I tried merging the interior Turm into the Turm (using every combination of backface filling between Turm and interior Turm) to no avail. I'm starting to see why they disabled the shadows in 1.4b now.
My crew saw their shadows and became spooked and deserted the sub.

Took out all the ConfigureBumpMap controllers in the Turm and the crew still had psychadelic colors on them. So it's something to do with the actual crew used as the watchstanders interacting with the shadow light source.

Last edited by TheDarkWraith; 02-20-09 at 02:50 PM.
TheDarkWraith is offline   Reply With Quote
Old 02-20-09, 04:05 PM   #90
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

ok, got the problem figured out. No wonder why the devs took the dynamic shadows out. They are a pain to setup correctly

here shows the shadows in the interior of the Turm and the shadow cast on the hull of sub (it's not broken!)


and check out this beautiful Turm shadow with the railing and all showing


Now to add my flags and pennants to it and see if they are shadowed (by all accounts they should be). I just might have to start playing SH3 again....
TheDarkWraith is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 03:56 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 1995- 2024 Subsim®
"Subsim" is a registered trademark, all rights reserved.