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 12-11-11, 11:29 PM   #271
iambecomelife
Silent Hunter
 
Join Date: Apr 2005
Posts: 4,588
Downloads: 297
Uploads: 0


Default

Beautiful. Thank you for your hard work. Sadly I know next to nothing about adding bump maps & shaders to models - this inspires me to look for a good tutorial. I'm tired of my models having a "washed out" look in SH4 and SH5.
iambecomelife is offline   Reply With Quote
Old 12-12-11, 01:23 AM   #272
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

You don't add shaders to the model. Those are for rendering in Game.
The Bump or 'Normal' textures are just converted from the base texture.
Photoshop will do them as will Gimp.
SH5 uses the Blue looking ones you get right off the bat.
SH4 swizzles the Blue and Green channels so you get the green looking ones.
The normals are mapped to channel 1 so no more UV mapping is needed from the base UV's.
  Reply With Quote
Old 12-12-11, 09:14 AM   #273
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by iambecomelife View Post
Beautiful. Thank you for your hard work. Sadly I know next to nothing about adding bump maps & shaders to models - this inspires me to look for a good tutorial. I'm tired of my models having a "washed out" look in SH4 and SH5.
You have shaders in SH4 unlike SH3. The shaders control the final pixel colors you see in-game. The great thing about shaders is you can make them do just about anything you want. I would suggest playing around with the shaders in SH4 to get rid of the washed out look. It's more than likely a post-processing effect that's controlling the final look of the game.

Shaders don't have to just control final pixel color in rendering. You can have them write to a texture and then you can use that texture later on in another shader (a type of shadows does this). You can do many things with them once you understand what you have available to you. I would read up on any DirectX books dealing with shaders you can find. Real time rendering is a great book but it's geared to the intermediate and up levels. A great first book is 'Introduction to 3D Game programming with DirectX 9.0c A shader approach' by Frank D. Luna. It was the first book I read when starting to learn about shaders and what you can do with them. Knowledge of C++ is needed for that book. I now write just about everything in C# and only use C++ when I need raw speed or when C# can't do what I need it to do. Microsoft made a managed library called Managed DirectX for C# but then quickly abandoned it. Why I don't know as it works quite well. That's what I'm using in this app (Managed DirectX) despite everyone saying don't use it.

DX10 and DX11 really opened up the power of shaders. With those you can generate verticies in the shaders! You can also do a great many things that DirectX9 shaders won't let you do. I have yet to read up on DX10 and DX11 shaders.

nVidia's FX Composer 2.5 is a great free app for shaders. Has a little bit of a steep learning curve to use but once you understand it you can litterly spend hours experimenting with different shaders and making your own and testing the changes. The great thing about it is it will verify your shaders for errors. It's fine to write them with Notepad but you get no error checking. FX Composer will find your typos and missing references.

Last edited by TheDarkWraith; 12-12-11 at 09:37 AM.
TheDarkWraith is offline   Reply With Quote
Old 12-12-11, 04:53 PM   #274
Jaeger
Chief
 
Join Date: Jul 2005
Posts: 316
Downloads: 28
Uploads: 0
Default

Hi TDW,

with your shader know how, would it be possible to change the unrealistic blurry look of sh4 to the more greyish atlantic look of sh3? the sh3 look is way more authentic in my view... atm the big plus of sh3 is the most immersive ingame look.


greetz, Jaeger
__________________
Everything comes to him who waits
Jaeger is offline   Reply With Quote
Old 12-12-11, 08:13 PM   #275
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Jaeger View Post
Hi TDW,

with your shader know how, would it be possible to change the unrealistic blurry look of sh4 to the more greyish atlantic look of sh3? the sh3 look is way more authentic in my view... atm the big plus of sh3 is the most immersive ingame look.


greetz, Jaeger
Should be fairly easy to do. It's more than likely a post-process effect. A post-process effect works on the frame buffer (everything that was rendered for the scene). I'll have to look and see what SH4 has for post-process effects...I see some likely candidates that could be doing it located in \data\Filters. I'll play around with them

It wasn't a post-process effect like I thought. It was a compound filter! Anyways I have it looking SH3 like now. Making a mod of it and going to put in SH4 threads. User has option to choose between 4 different rendered 'scenes' by simply editing a text file.

Here's the link to the mod for those interested: http://www.subsim.com/radioroom/show...98&postcount=1

I can change the rendered scene color to anything...if you want it more biased to red, blue, green, or any other color just let me know

Last edited by TheDarkWraith; 12-12-11 at 09:28 PM.
TheDarkWraith is offline   Reply With Quote
Old 12-13-11, 04:51 AM   #276
Jaeger
Chief
 
Join Date: Jul 2005
Posts: 316
Downloads: 28
Uploads: 0
Default

you are genius, tdw!,

its a pity i cant test. will be back home in two weeks and test it!
__________________
Everything comes to him who waits
Jaeger is offline   Reply With Quote
Old 12-17-11, 01:31 AM   #277
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

been working heavily on this app:


Now I remember why I don't use shadow maps....Point lights I was coding in the ability to cast shadows from the lights and all was well till I enabled a point light (a directional light would've been a problem also since one has to change how the camera 'sees' the scene and has to move the camera to a position from the light's perspective and that position has to encompass the view frustum) Now I have to go back and remove the shadow maps code and change it to shadow volumes instead. Yes they are heavier on the fill rates but with such a simple 'scene' being rendered here it should be no issue.

I gave the app the ability to render the mesh's bounding sphere and/or bounding box. Currently these are the computed ones by DirectX but I'll add the ability to use the bounding box defined in the GR2 file.

Multi-sampling was added (up to 8X). The app will check what the capabilities of your video card is and set the appropriate multi-sampling.

Text overlays have been added. Pressing H will show the overlay on the upper right. Press T will show the overlay on the upper left.

The upper left overlay shows total verticies rendered (including those for the fog depth map and (upcoming) shadow volumes). It also shows the total time (in milliseconds) to render a frame (the scene). The scene is not automatically updated because there is no game loop and no message pump per se. But clicking on the model area and moving mouse back and forth will cause the 'scene' to be re-rendered.

I also added camera frustum culling to help with rendering HUGE meshes. The current number of meshes culled by the camera from it's current viewpoint is shown. Culling is done by testing AABBs against the camera frustum planes.

Fixed some bugs in my shader code dealing with lighting.

Going to add the ability to change text overlay color and bounding box/bounding sphere colors. Currently they are linked to the Render tabs solid color.

When you are using the shaders as the renderer I'm using a post-process shader to render the final image. This way I can add fog effects to the scene based on the fog depth map.

Might add the ability to set an environment cube map so you can have a 'scene'. Thought about adding water or some kind of terrain so a true scene can be had...


Last edited by TheDarkWraith; 12-17-11 at 01:48 AM.
TheDarkWraith is offline   Reply With Quote
Old 12-17-11, 07:30 AM   #278
tonschk
Admiral
 
Join Date: Mar 2007
Posts: 2,200
Downloads: 172
Uploads: 0
Default

This is Really Very Good , Well Done TheDarkWraith
__________________
What we do in life echoes in Eternity
tonschk is offline   Reply With Quote
Old 12-17-11, 04:30 PM   #279
Vanilla
Lieutenant
 
Join Date: Nov 2006
Location: St. Petersburg, Russia
Posts: 264
Downloads: 72
Uploads: 0
Default

I wonder what is this huge outermost bounding sphere is there for?
Vanilla is offline   Reply With Quote
Old 12-17-11, 04:40 PM   #280
mobucks
Seasoned Skipper
 
Join Date: Jan 2010
Posts: 713
Downloads: 209
Uploads: 0
Default

I guess those are the pointlight vertexes he was talkin bout.. No idea really. Anyway looks like a lot of work, thanks for doing this!
mobucks is offline   Reply With Quote
Old 12-17-11, 04:46 PM   #281
TheBeast
The Old Man
 
Join Date: Jan 2010
Location: Lynnwood, WA
Posts: 1,533
Downloads: 876
Uploads: 23


Default Unable to Move Node Position

I am using v1.0.429.0

Not sure if this is Supported yet.
I am trying to move the Position of a Node I added but changing the X,Y,Z Coordinates does not move the Node.


Regards!
TheBeast
__________________
Fear me! I am, TheBeastBelow

SHIV-MediaFire | SHV-MediaFire
TheBeast is offline   Reply With Quote
Old 12-17-11, 07:41 PM   #282
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by TheBeast View Post
I am using v1.0.429.0

Not sure if this is Supported yet.
I am trying to move the Position of a Node I added but changing the X,Y,Z Coordinates does not move the Node.
You double click the line to bring up the editor screen? If so and you change the position and it tells you position was changed successfully? If so and you don't see any change? If so can you send me the file in question so I can test it

I'll try moving a bone in one of the files on my end and see what happens. Maybe I'm not updating the bones and only updating meshes...hope not.
TheDarkWraith is offline   Reply With Quote
Old 12-17-11, 07:48 PM   #283
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Vanilla View Post
I wonder what is this huge outermost bounding sphere is there for?
That's the bounding sphere DirectX calculated for the hull of the bismark. What's interesting is that I would've thought the sphere would touch the front and back at one spot. It does this for the back but the front is WAY out in front of the hull. The hull is centered on the origin and about the same size front and rear of the origin. This can only mean there are some verticies in the mesh that aren't being used and they are located WAY up in front.

When you ask DirectX to calculate the bounding sphere of a mesh you pass in the verticies of the mesh as one of the parameters. You get back the center point (Vector3) and the radius (float) of the sphere. I take that center point and radius and use them to create the sphere (it's an intrinsic mesh in DirectX). When I render it I set up a matrix that is this center point and the model/world transform so it's located where it needs to be on the model.
TheDarkWraith is offline   Reply With Quote
Old 12-17-11, 08:30 PM   #284
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

The bounding sphere is not relevent for SH5 that I could prove.
Maybe in a LOD situation? But Granny takes over there so it should be a depricated feature of your program.
Don't confuse users with bells and whistles at this point!
Most people don't even understand what a Vert nor it's postional data means.
Let alone the Tangents and Normals stuff.
Remember the basic rule? KISS
  Reply With Quote
Old 12-17-11, 10:25 PM   #285
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by TheBeast View Post
I am using v1.0.429.0

Not sure if this is Supported yet.
I am trying to move the Position of a Node I added but changing the X,Y,Z Coordinates does not move the Node.
I loaded the Uboat_Sensors file in the app and was able to move bones around. So in order to figure out why you're having problems I need to use the file you tried.

I did though find errors in the code that handles the TreeView for these bones. To draw the TreeView the code does this:

for every file (app has ability to have more than 1 GR2 file loaded though that feature is currently disabled)
- draw a node and update file index counter
---- for every model in the file (you see this as skeleton since models only have 1 skeleton)
----- draw a node and update model index counter
-------- for every bone in the model (skeleton)
--------- draw a node and update bone index counter

Problem was I was never resetting the model or bone index counters whenever a new model or file was used! I have corrected the problem and will be available in next version
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 02:43 AM.


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.