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 > SH5 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 05-04-11, 12:31 PM   #1
Zedi
Sea Lord
 
Join Date: Mar 2010
Posts: 1,845
Downloads: 184
Uploads: 2
Default

If im going wild and I create a ship in Max, how would I import it in SH5? Is that possible at all?
Zedi is offline   Reply With Quote
Old 05-04-11, 02:38 PM   #2
Rongel
Grey Wolf
 
Join Date: Jan 2009
Location: Finland
Posts: 857
Downloads: 174
Uploads: 0
Default

Quote:
If im going wild and I create a ship in Max, how would I import it in SH5? Is that possible at all?
It makes my head hurt just thinking about it Who knows, maybe it's easier than this stuff!

By the way, one weird thing I have noticed is that we can edit .val file, and the changes show, we can make a nice wake and foam, but why is .sim forbidden? I mean I can edit it in S3D or in Goblin, but haven't seen any changes in game. And it contains all the nice stuff, reflections, caustics and so on....
Rongel is offline   Reply With Quote
Old 05-04-11, 05:25 PM   #3
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Zedi View Post
If im going wild and I create a ship in Max, how would I import it in SH5? Is that possible at all?
Export to .obj format. Create new Type 4/0 node and import 3D model into it (using Pack3D). I can do this really fast using hex editor....

@ Rongel: if you look at the ships I sent you they all have the new SH5 wake controllers added. Look at the wakes (they even make their own waves at high speeds)
TheDarkWraith is offline   Reply With Quote
Old 05-04-11, 07:34 PM   #4
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

after much thought about why the caustics effect is only showing on one side (for DAT file units) I came to the conclusion that the shader isn't 'interpreting' the normal map correctly. More specifically since the normal map is mirrored to the other side of the ship it will pose problems for the caustics pixel shader (upon looking at what the caustics pixel shader was doing I was correct). So I made some changes to the caustics pixel shader
Here's what I've done:
the pixel shader takes the light direction and the texel normal and does a dot product on them (both of these are vectors). It then throws this into a saturate function which just clamps the value to between 0 and 1. Do you see the problem??? I do. If the light direction and texel normal basically point in the same direction (texel is facing light) the dot product value will be > 0. If they point in basically opposite directions the dot product value will be < 0 (texel is facing away from light). Recall the saturate function clamps to between 0 and 1. Now since the normal map is mirrored on the other side of the ship, the side facing away from the light will always have a dot product value < 0 (the light direction is from the object to the light source not the other way around). PROBLEM To fix this I made the pixel shader for the caustics check the dot product value and if it's < 0 then flip the light direction (so now the light source is coming from the other side of the unit). Now caustics are displayed on both sides of the ship

Last edited by TheDarkWraith; 05-05-11 at 01:08 AM.
TheDarkWraith is offline   Reply With Quote
Old 05-04-11, 08:09 PM   #5
THE_MASK
Ace of the deep .
 
THE_MASK's Avatar
 
Join Date: Jan 2006
Posts: 9,153
Downloads: 901
Uploads: 73


Default

Another problem solved , thankyou .
THE_MASK is offline   Reply With Quote
Old 05-04-11, 08:31 PM   #6
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Here you can see the effects of my Caustics PS change. Clearly you can tell the sun is shining on the other side of the ship


Once again unlit side in brighter daylight. I increased the caustics effect range on the unit. Instead of rendering only to a little area next to the waterline it renders more up the side of the unit. Should it render even higher

Last edited by TheDarkWraith; 05-05-11 at 01:09 AM.
TheDarkWraith is offline   Reply With Quote
Old 05-04-11, 11:45 PM   #7
stoianm
Ocean Warrior
 
Join Date: Dec 2010
Location: Montreal, Canada
Posts: 2,776
Downloads: 833
Uploads: 11
Default

Quote:
Originally Posted by TheDarkWraith View Post

very nice... will be cool if you will find a solution to put caustic on plants and rocks... i can not do that
btw... the water color is from last dynamic?... if yes you think is to much green?
stoianm is offline   Reply With Quote
Old 05-05-11, 12:57 AM   #8
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Whoever wrote the Unified Render shaders needs their head examined

[begin rant]
Let's see....caustics effects.....they are sunlight reflections/refractions off the water onto the unit.....so why would someone model them as sunlight striking the side of the unit I rewrote the pixel shader so that the light used for lighting calcs for this effect is modeled as light coming off the water and not from the sky. Now light is absorbed by water and reflected/refracted more underwater...this is a given. So why would someone model the caustic effect above water and below water the same Once again I rewrote this part of the pixel shader so that the caustic effects above water are much more vivid than below water. The light used for the light calculations for the caustic effects below water uses light coming from the sky. C'mon now, this stuff isn't rocket science. It's quite evident that the person who wrote this shader has no clue about nature and general physics And this is the first shader I've looked at...there are many more....
[/end rant]

Almost all the problems (I believe) we are having with rendering units with .dat files is because of the shaders.

Now I must pull out my reference books on shaders and do a little reading up/refreshing....
TheDarkWraith is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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 02:30 PM.


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