Which shader...?

Users who are viewing this thread

ThaneWulfgharn

Master Knight
Which shader ingame on the same time:
-Supports transparency
-Moves,like the water in the map rivers
-Is applicable to weapons,helmets,boots,armors,gloves?
 
ThaneWulfgharn said:
Which shader ingame on the same time:
-Supports transparency
-Moves,like the water in the map rivers
-Is applicable to weapons,helmets,boots,armors,gloves?

Any referenced shader can be applied to any material.
I think that you'll end needing a custom one, or at least asking someone to do a remix.

What's its purpose? :smile:
 
For transparency you mainly need to set the correct flags. As for moving textures... I'm not sure if it works for other stuff as well, but just take a look at how the water texture is set up.
 
I'd say that simply using the standard normalmap shader, and forcing it to do UV scrolling [
Code:
tex.uv+=time_var
]
when sampling a secondary texture and linearly interpolating [
Code:
lerp(diffuse1,diffuse2,step)
] that with the base will do the trick.

If you want ghosty style transparency then just modulate the final output alpha channel by a
Code:
sin()
or cos() function.
Something like
Code:
Output.color.a *= sin(time_var/4) //tweak this :)

It's just adjusting the shader reference in the BRF to use
Code:
diffuse2
slot with alpha channel.
Then tweaking a custom pixel shader and bind the technique.


Nothing fancy. But I can't do it for you right now, I'm a bit busy at the moment.
Maybe Barabas or xenoargh may help you with that.
 
La Grandmaster said:
This is a bit beyond my knowledge but I assume to do this you would need to edit the mb_2.fxo files?

The shader files are being distributed on here:
Code:
http://www.taleworlds.com/download#LeftMenuNew
(the latest item in the list)

.FX are in HLSL (High Level Shading Language) that is the source in plain text. (You can alter existing shaders and add techniques later used in BRFs)
.FXO are the compiled binary files, that cannot be modified but load faster when the engine starts.

You can feed the game with either one.
It doesn't matter, just take care of renaming the final file as
Code:
mb.fxo
within your module folder.
 
Can we edit the .fx, then manually compile it to an .fxo, so it's custom and loads faster? :razz:
EDIT: Oh, there is a compile_fx.bat included in the archive. I might just start learning shaders.
 
Ok.I downloaded the shader files.
Now,first of all,where to put the files so that they compile correctly?

Second,the dot3 technique supports transparency with the correct flags.dot3_alpha shader is the proof of that.
I need only to copy dot3 and add the movement of the texture to it.But I don't know how to do it.

Third:Can I just simply make a copy of dot3_alpha in the core_shaders.brf and just set its technique to watermap?
 
ThaneWulfgharn said:
Ok.I downloaded the shader files.
Now,first of all,where to put the files so that they compile correctly?

Second,the dot3 technique supports transparency with the correct flags.dot3_alpha shader is the proof of that.
I need only to copy dot3 and add the movement of the texture to it.But I don't know how to do it.

Third:Can I just simply make a copy of dot3_alpha in the core_shaders.brf and just set its technique to watermap?

First of all, don't confuse shader references/definitions and shaders. It's like the texture refs within your BRF files.
They aren't there physically, they are just like a link that specifies its name and properties
(stored as flags, that you can see with OpenBRF)

The thing goes like this:

Code:
[color=navy]<--- TEXT FILES---> <-------- BRF FILE -------------> <--- external --->[/color]
ITEM_KINDS.TXT      MESH -> MATERIAL -> SHADER REF -> shading technique in mb.fx -> pass -> vertex shader / pixel shader
SCENE_PROPS.TXT                      -> TEXTUR REF -> *.DDS filename
SKINS.TXT                   +flags      +flags
MESHES.TXT                            
...                 COLLIS.
                    BODY -> 
                            +flags

                    ANIM ->

                    SKEL ->
                      
                    ...


A shader ref does much more than just tell the game what technique has to use, it has its own set of properties (flags/indicators).

For example; enabling specularity and hardware rigging. Another important part are texture sampler slots.
Some shaders need more textures, not only diffuse/albedo, for example, faces have two diffuses: one young and other old.

You need to specify all this, for the shader to work properly.

The best thing is just toy with it, change values until you understand what they do. That's how I learnt. At least in Mount&Blade 1.011 you can reload the shader file by pressing Ctrl+F with the edit mode enabled. I believe they disabled this on Warband, but I'm not 100% sure.
 
Back
Top Bottom