Author Topic: [OSP]Tama's Shaders (Dynamic Parallax Occlusion & Parallax & SSAO)  (Read 12443 times)

0 Members and 1 Guest are viewing this topic.

Tama

  • Veteran
  • *
    • View Profile
  • Faction: Neutral
          INFORMATION:

This Mod/Kit whatever you want to call it includes the following:
  • Dynamic Parallax Occlusion with self-shadows(Only for static models, single light source. Good for outdoors.)
  • Parallax Shaders
  • Source Code
  • Shader Compiler
  • Fixed Normal Maps with Height Maps
  • SSAO Shader

Basically it adds Parallax Occlusion effect on ground and wall textures and some few other textures.

The shaders are written by me, however they look similar with Barabas' Shaders. His shaders actually helped me make this, because at first I tried to use his. But they weren't working right and his source resisted against getting compiled. So I based my shaders upon his.

I will update this as I add more features. probably.
Todo: Depth Biasing or something faster, self-shadows or depth based shading(faster but doesn't look as awesome)

          SCREENSHOTS:

Dynamic Parallax Occlusion:
(click to show/hide)

SSAO Comparison. First Image with ssao, second image without ssao.
(click to show/hide)
Other Screenshots:
(click to show/hide)


          DOWNLOAD LINK:

https://1drv.ms/u/s!AuvC0xVuBv2Ezuc_BxxwweTzejd-Gw - Added Dynamic Parallax Occlusion 11-Dec-16


          HOW TO INSTALL:

The paragraphs starting with * are important. Please read them not to screw your game/mods.

---Step 1:

Download and unzip the .zip file first.

---Step 2:

Then copy all the contents except "module.ini" inside the unzipped folder to the mod you want to play this with. If you want to play this with native. Then go ahead and copy-paste module.ini as well. You can safely replace that file only if you are copying the files to native.

*However, if a "file exists do you want to replace" kind of window pops up click cancel, because probably the mod you want to play this with could have custom shaders of it's own.

*Or you could have tried to copy "module.ini" as well. Even tho I told you not to. If that is the case go back to the start of this step. (Step 2)

---Step 3 (required step for mods/but not native):

If you copied the files to a mod instead of native. There is one final step, which is opening up the module.ini of that mod. And adding "load_mod_resource = parallax_materials" without brackets just above "load_resource = materials". If you put it below it won't work, because warband engine.

---Step 4:

Play.


     MORE THINGS YOU NEED TO KNOW:

Even if the mod you want to play this with doesn't have any custom shaders and anything like that and you copied all the files successfully, you must know that not all texture's in the mod will look awesome. That is because the mod materials won't use parallax shader. But any material native uses will use the parallax shaders.

Furthermore, I guess this would also be useless in total-conversion mods that doesn't use the native ground and wall textures.

I haven't been able to make heightmaps to all native textures. It would be great if you can make them and send me a pm, then I'll update this post. Such textures are inside the Textures folder too.

I guess this wouldn't necessarily be necessary for total-conversion mods unless the mod uses the native ground or wall textures at best.


          TECHNICAL STUFF FOR MODDERS:

Dynamic Parallax Occlusion Update Info:
Additionally to all the other instructions, You need to enter the texture width, height and heightMapScale to dynamic parallax occlusion material. You can enter these values to Spec Color textboxes in OpenBrf. If that doesn't make any sense, check out this screenshot:
(click to show/hide)



If you want to use the shaders and heightmaps provided in this kit you have to credit me and provide a link to this topic so others could see it and use for themselves aswell.

The shaders use the blue channel just like in barabas' shaders. Why you might ask? Because a heightmap is just a graycolor image it is either 0 or 1. AAaaand, warband materials doesn't support a heightmap texture input. But its unnecessary as using a separate texture would increase file sizes, besides blue channel in warband normal maps are mostly unused. It is possible to calculate the z of the normalmap by using x and y of it. In fact this is what the shaders included here does.

If you want to make a heightmap for a certain texture. Place it in the blue channel of it's normalmap. And save it as DDS DXT1.

You can find all the parallax materials in parallax_materials, duh. But whats more? You can also find all the normalmaps used by those materials inside the Textures folder with their blue channel correctly set with it's heightmap. However I wasn't able to make heightmaps for few of those. If it's looking blueish purplish, then it probably doesn't have a correct heightmap but check the blue channel to make sure. You can try to fix those and please give me a link so i can update the download link with those.

To see all the available shader types available in this Kit, open Core_Shaders.brf inside the Resource folder. Each shader with _parallax prefix at the end or somewhere in the middle requires a normalmap texture with a heightmap placed in it's blue channel. The shader names are usually the same with their native counterparts which doesn't have parallax. The aforementioned shaders are also set as fallback's. But parallax is a simple technique and I don't think the fallbacks are necessary, but better to be safe than sorry.

If you have you own custom shaders but you want to use this one as well, have no fear as I've included the real deal. If you haven't changed/edited any of the native shaders, that is perfect. You can use this one as a base and copy paste your custom shader codes inside this kits shader source file. But If you've made changes to techniques ps_main_bump and ps_standart_new (I might be forgetting some), I'm afraid it is going to be more complicated than that.

But still not impossible. I've made changes to original native normal calculations and added parallax calculations. That is all there is to it. So make sure that my changes doesn't collide with your changes.

After you are done, copy paste the shaders inside Core_Shaders.brf with _parallax prefixes. And you are done.

* Use at your own risk. If it fails or something gets burned, I'm not responsible. But I highly doubt that anything would get burned, might fail..., but not fire.
« Last Edit: June 02, 2018, 05:21:04 AM by Tama »
Tama's Enchanced Native Mod
Tama's Shaders
M&B Repository Account

-Commandment nr.3 Taken from the Great Tome of Revelation: Thou shalt not feed milk to cat nor hedgehog, for lo! they doth struggleth with lactose intolerance.

HyperCharge

  • Modification Area Moderator
  • *
  • I am Uthred, son of Uthred
    • Twitch.tv - Hypercharge
    • YouTube - HyperDMG2
    • View Profile
  • Faction: Neutral
  • MP nick: Çaktırma
  • WBNWWF&SVC
Terrain looks like this;

(click to show/hide)


Otherwise, looks good!

(click to show/hide)

BNS Marko

  • Q&A Lover
  • Moderator
  • *
    • Steam - markalone
    • Twitter - BadNameStudios
    • Twitch.tv - badnamestudios
    • YouTube - UCYSn5Pt6U6Aro-6_bSNWDgA
    • View Profile
    • Star Wars: Bear Force II
  • Faction: Nord
  • MP nick: BNS_Marko
  • WBNWM&BWF&SVC
The second screenshot of yours HyperCharge, is that just clean Native with the parallax? Or any additional effects applied to it?

HyperCharge

  • Modification Area Moderator
  • *
  • I am Uthred, son of Uthred
    • Twitch.tv - Hypercharge
    • YouTube - HyperDMG2
    • View Profile
  • Faction: Neutral
  • MP nick: Çaktırma
  • WBNWWF&SVC
The second screenshot of yours HyperCharge, is that just clean Native with the parallax? Or any additional effects applied to it?

With shaunremo's skybox osp :)

BNS Marko

  • Q&A Lover
  • Moderator
  • *
    • Steam - markalone
    • Twitter - BadNameStudios
    • Twitch.tv - badnamestudios
    • YouTube - UCYSn5Pt6U6Aro-6_bSNWDgA
    • View Profile
    • Star Wars: Bear Force II
  • Faction: Nord
  • MP nick: BNS_Marko
  • WBNWM&BWF&SVC
Ah, all the colours seem a bit more vibrant.

HarryPham123

  • Knight
  • *
    • View Profile
  • Faction: Swadian
so i have done all your direction but it turn all white  :?

Hurleur

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Neutral
Terrain looks like this;

(click to show/hide)


Otherwise, looks good!

(click to show/hide)

Yep , same here , all good but the Terrain .

Tama

  • Veteran
  • *
    • View Profile
  • Faction: Neutral
HyperCharge:

The problem mostly lies with the grass heightmap. Notice the other kind of terrain textures aren't looking bad. To make it go away delete normalmap texture in module textures folder. Then it will revert back to original texture.

Yes the colours seem to be a bit vibrant in your screenshots.

HarryPham123, Hurleur:

You might have forgotten to copy "mb_2a.fxo" file. But If you did then change its name to "mb_2a.fx" and try again. If this is not the case however I don't know what went wrong. Please post a screenshot of the whiteness, is it complete white or only ground and walls while?
Tama's Enchanced Native Mod
Tama's Shaders
M&B Repository Account

-Commandment nr.3 Taken from the Great Tome of Revelation: Thou shalt not feed milk to cat nor hedgehog, for lo! they doth struggleth with lactose intolerance.

Hurleur

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Neutral
Sorry , my post was certainly unclear , i have the same thing happen than Hypercharge , lot of seams on terrain.
Now all is fixed

Tama

  • Veteran
  • *
    • View Profile
  • Faction: Neutral
More Screenshots:
(click to show/hide)

I'm satisfied with how it looks, however there are still some tweaking and issue handling to do.
But here's the new updated download link: https://1drv.ms/u/s!AuvC0xVuBv2EwtsDG6IrUp8islsjDg
Quick Fix Patch for the above update: https://1drv.ms/u/s!AuvC0xVuBv2EwtsEe2rlWUIt-bEmmQ (Fixes multimesh weird seam error)

P.S. Screenshots are from my Enhanced Mod. It uses Realistic Colors Mod so it might look a bit different than native.
« Last Edit: June 21, 2016, 08:21:06 PM by Tama »
Tama's Enchanced Native Mod
Tama's Shaders
M&B Repository Account

-Commandment nr.3 Taken from the Great Tome of Revelation: Thou shalt not feed milk to cat nor hedgehog, for lo! they doth struggleth with lactose intolerance.

produno

  • Master Knight
  • *
  • AWoIaF Developer
    • Twitter - @TheRealProduno
    • YouTube - Produno
    • YouTube - UC3bE9brC2akVBYo5-HT0U-Q
    • View Profile
    • Official A World of Ice and Fire Webpage
  • Faction: Neutral
  • M&BWBWF&SNW
Why does the stone floor look very flat? Is this because you removed the normal map as mentioned above?

Tama

  • Veteran
  • *
    • View Profile
  • Faction: Neutral
Why does the stone floor look very flat? Is this because you removed the normal map as mentioned above?

No I didn't remove the normalmap, you must have misunderstood me. It looks flat like that because it doesn't have a nice shading and self-shadows. It is actually pretty hard to calculate all those shadows and stuff with sm2.0 and warband. But I'm trying to improve it as we speak.
Tama's Enchanced Native Mod
Tama's Shaders
M&B Repository Account

-Commandment nr.3 Taken from the Great Tome of Revelation: Thou shalt not feed milk to cat nor hedgehog, for lo! they doth struggleth with lactose intolerance.

Alphα

  • Baron
  • *
  • Env Artist student - Freelance level artist
    • Steam - AlphA-Fr
    • Twitter - AlphAIFr
    • Twitch.tv - alphalfr
    • YouTube - AlphAlFrl
    • View Profile
    • alphas-projects
  • Faction: Rhodok
  • MP nick: AlphA
  • WBWF&SNW
Hey you should move your topic to : https://forums.taleworlds.com/index.php/board,229.0.html
Nice work btw

Tama

  • Veteran
  • *
    • View Profile
  • Faction: Neutral
Hey you should move your topic to : https://forums.taleworlds.com/index.php/board,229.0.html
Nice work btw

Thanks! I will do that once I got rid of the issues :)
Tama's Enchanced Native Mod
Tama's Shaders
M&B Repository Account

-Commandment nr.3 Taken from the Great Tome of Revelation: Thou shalt not feed milk to cat nor hedgehog, for lo! they doth struggleth with lactose intolerance.

HarryPham123

  • Knight
  • *
    • View Profile
  • Faction: Swadian
hello Tama well i have fixed it so it look awsome in my mod so here is my image http://imgur.com/a/w5xSb