![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
|
|||||||||
![]() |
|
|
Thread Tools | Display Modes |
|
|
05-04-11, 12:31 PM
|
#1 |
|
Sea Lord
![]() Join Date: Mar 2010
Posts: 1,845
Downloads: 184
Uploads: 2
|
If im going wild and I create a ship in Max, how would I import it in SH5? Is that possible at all?
|
|
|
05-04-11, 02:38 PM
|
#2 | |
|
Grey Wolf
![]() Join Date: Jan 2009
Location: Finland
Posts: 857
Downloads: 174
Uploads: 0
|
Quote:
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.... |
|
|
|
05-04-11, 05:25 PM
|
#3 | |
|
Black Magic
![]() |
Quote:
@ 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)
|
|
|
|
05-04-11, 07:34 PM
|
#4 |
|
Black Magic
![]() |
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. |
|
|
05-04-11, 08:09 PM
|
#5 |
|
Ace of the deep .
|
Another problem solved , thankyou .
|
|
|
05-04-11, 08:31 PM
|
#6 |
|
Black Magic
![]() |
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. |
|
|
05-04-11, 11:45 PM
|
#7 |
|
Ocean Warrior
![]() Join Date: Dec 2010
Location: Montreal, Canada
Posts: 2,776
Downloads: 833
Uploads: 11
|
|
|
|
05-05-11, 12:57 AM
|
#8 |
|
Black Magic
![]() |
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.... |
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
