Home Dota 2

GLSL viewport shader for Blender

TurboHusky
polycounter lvl 10
Offline / Send Message
TurboHusky polycounter lvl 10
Hey there,

Had a lash at making a real-time viewport shader for anyone trying to create content in Blender. Yes, real time, in the viewport.

It consists mostly of hacks and a ton of nodes, but it seems to more or less work. I'd be interested to see if it's of any use to anyone, and also how close I got with it... There are bound to be a few goofs in there, but it's at a stage now where it's pretty developed, can be easily tweaked, and really needs to go live in the wild.

Here's the hype page:
http://steamcommunity.com/sharedfiles/filedetails/?id=716302087

And the DL:
http://www.blendswap.com/blends/view/85087

Replies

  • TurboHusky
    Options
    Offline / Send Message
    TurboHusky polycounter lvl 10
    And a screenshot with a couple of models set up.


  • TurboHusky
    Options
    Offline / Send Message
    TurboHusky polycounter lvl 10
    Specwarp in action...

  • Vrav
    Options
    Offline / Send Message
    Vrav polycounter lvl 11
    Hey, this seems pretty cool!

    I don't think it's possible to set up with how the hero textures download now, channels all split up instead of mask1/mask2. Could composite them manually I guess, but it would be cool if there were optional single greyscale texture slots for the various mask elements.
    edit: or I could just extract/convert the game files like a non-lazy person... :P
  • TurboHusky
    Options
    Offline / Send Message
    TurboHusky polycounter lvl 10
    Good news, it's totally possible! The shader actually requires the masks be separate, hence the extra input materials at the front end. All the mask slots are there, so if you have the individual textures it's actually a bit easier to set everything up properly.

    First of all you can delete everything in the Source 1 mask setup frame (All this did was separate the RGBA channels from the combined textures), then just stick the individual textures directly into the appropriate node inputs on the main shader node (set the textures up as per the colour, i.e. use an input texture node and feed in the UV coords as input).

    I actually found the old combined textures a much bigger pain in the ass, as Blender has a funny way of handling alpha channels. If you use the old combined textures you have to use a shadeless material and load them in twice, once to extract RGB and once to get the alpha. This was the easiest method I could come up with, but If there's a better way out there to get at RGBA channels I'd love to know about it.

    The other thing I have found is that zip files for the newer/revised models tend to be missing some of the masks. I ended up having to extract a whole bunch of textures via the workshop tools for testing purposes, which was something of a hassle.
  • TurboHusky
    Options
    Offline / Send Message
    TurboHusky polycounter lvl 10
    FYI I've updated the file to include two setups. One for combined masks (old Source1 style) and one for separate masks (newer style). The shader itself is exactly the same for both, it's just how you feed in the textures. Hope that makes things a little clearer...
Sign In or Register to comment.