SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
12-11-11, 11:29 PM | #271 |
Silent Hunter
|
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.
__________________
https://www.facebook.com/WolvesoftheKaiser/ |
12-12-11, 01:23 AM | #272 |
Stowaway
Posts: n/a
Downloads:
Uploads:
|
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. |
12-12-11, 09:14 AM | #273 | |
Black Magic
|
Quote:
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. |
|
12-12-11, 04:53 PM | #274 |
Chief
Join Date: Jul 2005
Posts: 316
Downloads: 28
Uploads: 0
|
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 |
12-12-11, 08:13 PM | #275 | |
Black Magic
|
Quote:
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. |
|
12-13-11, 04:51 AM | #276 |
Chief
Join Date: Jul 2005
Posts: 316
Downloads: 28
Uploads: 0
|
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 |
12-17-11, 01:31 AM | #277 |
Black Magic
|
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. |
12-17-11, 07:30 AM | #278 |
Admiral
Join Date: Mar 2007
Posts: 2,200
Downloads: 172
Uploads: 0
|
This is Really Very Good , Well Done TheDarkWraith
__________________
What we do in life echoes in Eternity |
12-17-11, 04:30 PM | #279 |
Lieutenant
Join Date: Nov 2006
Location: St. Petersburg, Russia
Posts: 264
Downloads: 72
Uploads: 0
|
I wonder what is this huge outermost bounding sphere is there for?
|
12-17-11, 04:40 PM | #280 |
Seasoned Skipper
Join Date: Jan 2010
Posts: 713
Downloads: 209
Uploads: 0
|
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!
|
12-17-11, 04:46 PM | #281 |
The Old Man
|
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 |
12-17-11, 07:41 PM | #282 | |
Black Magic
|
Quote:
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. |
|
12-17-11, 07:48 PM | #283 | |
Black Magic
|
Quote:
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. |
|
12-17-11, 08:30 PM | #284 |
Stowaway
Posts: n/a
Downloads:
Uploads:
|
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 |
12-17-11, 10:25 PM | #285 | |
Black Magic
|
Quote:
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 |
|
|
|