Realtime PBR in Blender

Posted by Aidy Burrows on August 24th, 2016 | Comments (23)

 

After this PBR video you’ll know…

● An amazing great indie game project using Blender > Unreal Engine 4 = Swarm : Manchester. ;D

● Several realtime PBR solutions for Blender that emulate the Unreal Engine 4 look and material inputs.

● PBR sometimes stands for Professional Bull Riders.

● You caught me out since this list is padded with non information such as this line.

● How to quickly setup the experimental real-time Cycles build

● Proper Fresnel in Blender internal and it’s limits.

● A new blender game engine in development.

● A sense of completion for reading all the way this far down the bulletpoint list. Bulletpoint list reading level up!

 

Real-Time PBR Blender internal file can be found here.

 

UE4 vs Blender

I’ve been texturing and developing for my own game project in Unreal Engine 4 – Swarm : Manchester. Something I found a growing need for was a real-time display of the UE4 PBR setup within Blender.

PBR in a game engine means we need these textures….

● Roughness

● Metalness.

But where do we put them in Blender?

So I’ve dug around and created my own solution and been generally keeping my eye on the scene, and now I’d like to present in this video the best real-time PBR options currently available for Blender and how to use them.

 

 

LIMITATIONS

Check out the image below, that’s pretty close for blender internal right?! It’s a reasonable approximation surely! The biggest thing missing is the Fresnel – check out how on the UE4 sphere there’s a greater reflection at the glancing angles – that’s Fresnel in action. So in the video we go into why that is and possible solutions.

 

pbr blender ue4 compare

 

 

RESOURCES

PBR Real-time shader for Blender Internal.

Swarm : Manchester Game Project.

Malte Szellas UE4 Cycles Shader Youtube how-to. 

Experimental Real-Time Cycles Build by Clément Foucault.

Daily build of blender

UE4 PBR Documentation.

Epic’s Showdown Virtual Reality Video

HDRI Haven – Sweet Environment Maps.

Blender 2.8 Viewport project.

New in development Blender Game Engine Proejct – Armory 3D.

 

There’s always room to develop the shader further, so if you do decide to take it further or take it another way, you know i’m interested so keep us posted!

Aidy.


 

 

 

Suggested Videos/Related Content >

Quick Ornamental Detail

blender tutorial align 2 faces

blender tutorial 5 blender viewport tips

 
 
 
 
 
 
 
 
 

 

 

 

Save

Save

Save

Save

Save

Save

Save

Save

Save

Save

Save

Save

Save

Save

Save

Save

Save

Save

Save

Save

Save

Save

Save

Save

Save

Save

Save

Save

  • Marvin

    I just wonder what is the benefit of setting up the material in Blender before you do that in UE4, instead of using the UE4 material editor for the first time? BTW, it looks pretty cool. .D

    • http://www.cgmasters.net/ Aidy Burrows

      Thanks! And great question, just so it’s clear to anyone reading this, exporting the model from Blender with this setup wont see the same setup automatically created in UE4, they’ll still need to plug in the textures, setup a material instance and everything else that i’ll likely go over shortly for anyone interested.

      The benefit is that you can get much further creating and even painting your own textures while still in Blender before it even leaves for UE4. You’ll have a clearer idea of how it’ll look, kind of like if you had the power of Blender’s modeling tools within UE4. You could continue working on the model while having a good idea of how it’ll look in the end.

      Hope that makes sense! 🙂 Aidy.

      • Marvin

        Hi, thank you for the quick answer! I am pretty interested in this project. Lately I am trying to create assets for UE4 using Blender but I had to realize what I create in cycles will look way different in UE4. Actually I need to recreate everything in UE4. I was thinking about forgetting setting up materials in Blender and only export mesh and base textures (like diffuse, normal, ao, cavity) but if this can work then I will give it a try. 😀
        So I am definitely interested in anything related to the material creation in UE4 using Blender.

        • http://www.cgmasters.net/ Aidy Burrows

          Yeah that sounds right, it’s fairly common that as you work on modeling and texturing the object for a game engine, you’ll have at least 2 main modes of thought.

          If it’s a hero asset (something that is a one off, doesn’t show up anywhere else in the scene/level and is usually pretty eye catching) then you’ll want to be able to get that pretty close all in Blender.

          If it’s a standard repeating asset that might be part of a modular kit, then very possibly you’ll want to just throw a standard tiling texture or simple material onto it.

          If I may ask what’s your typical texturing workflow? If you have a typical workflow that is. 🙂 Aidy.

        • Marvin

          Thank you for the tip.
          As for your question: well, I am still in the beginning but here is what works me most:
          I like to sculpt a high-res model in blender, then retopologize, bake ao, cavity, normal. I create diffuse color by tinting colors with ao, cavity and blending the result with photo. I blend the baked normalmap with detail normal created from photo. For specular and metalic I use single value/material (like wood, iron, water, etc.) I usually create roughness texture from the diffuse and then I use it to lerp between roughness values. I applied this method for rocks, bricks, iron fences, tileable floors, architectural elements and other items.

          Here are some shots from some of the results (I’m also open for any critic or idea since I’m a hobby artist still learning the process .D)

          https://www.dropbox.com/s/0c0vmtsepkjjy5x/b_u_shield.jpg?dl=0
          https://www.dropbox.com/s/n75yr0jrteuhrhf/floor1.png?dl=0
          https://www.dropbox.com/s/qerdmj4qr1y3ftv/cave.png?dl=0

        • http://www.cgmasters.net/ Aidy Burrows

          You’re doing some great work and are definitely on the right path.

          You’re workflow sounds pretty much spot on!

          As for any other ideas, I would say just keep on top of those references, it’s like creating a huge collage in your mind and then getting the distillation of each part of each reference you like and want to represent in your own models.

          In the early days we tend to just use 1 or 2 references and maybe almost straight off copy what we see, down the line we take about 10 and mix the metal from one, the shape from another, the use of color from something else and so on, even further down the line 100’s of references are in the mind and on the computer to keep checking some that don’t even make any kind of direct obvious connection with what you’re creating.

          Anyways, references, references, references, is always my main advice for anyone who wants to create anything. I ignored that advice for a long time, but now it opens up so many possibilities in anything, music, storytelling, art, whatever. It keeps you on track and it keeps the message consistent too so that the ‘art’ not just technically but emotionally packs that punch!

          Aidy. 🙂

          p.s. just because i say these words doesn’t mean i always follow that advice or have mastered it or anything, it’ll be a lifelong process for me! 😀

        • Marvin

          Thank you Aidy, your words means much for me. .D I will keep in mind your advice.

  • Robert Castaneda

    Hi Aidy,

    I was wondering if you seen the shader that was made by KjartanTysdal. He created a Cycles shader that takes in maps created by Substance Painter or Quixel. It’s on his Gumroad page and it costs 1.99EUR. Here is the link:
    https://gumroad.com/ktysdal

    • http://www.cgmasters.net/ Aidy Burrows

      Hi!

      Yeah I have seen that shader but I don’t have it to explore yet, Kjartan Tysdal is awesome and 1.99 is very reasonable!!!

      Thats very helpful, thanks for sharing the link here! 🙂 Aidy.

    • Warren D. M. Reed

      Thanks for sharing that!

  • Jain

    Why mirror effect from cube, disappear from ball, and vice versa ?
    So I can’t see ball, from shiny cube surface.

    Material only effected by environment HDR image only, right ?
    Not effected to nearest object or other emitted material?

    • http://www.cgmasters.net/ Aidy Burrows

      Hi!

      This isn’t screenspace reflections unfortunately. As is similar in many games, you’d need to bake the objects into a cubemap for use in that location.

      Baking maps is a little on the clunky side especially for this setup in blender internal.

      Though if you have access to the blender cycles realtime build that’s discussed later in the video, once objects are in position you can capture and update the viewport probe there which is a much faster process.

      My main concern has been the PBR options though for work with other applications that are using that workflow since it’s the now standard texture set that’s required. i.e. roughness etc.

      Aidy. 🙂

  • tysonhh

    I watched this tutorial when it came out, but I am only trying it today and I’m encountering a problem. When I open the blend file or even if I append the sphere material into another project, the sphere appears as if it is a shadeless orange color. Same with the cube, when it’s selected. Is there a setting I need to adjust or are newer builds of blender no longer able to run the material as it is? Thanks for your help.

    P.S. I make movies and I am very interested in these tests because I’m looking for a free alternative to Element3D (a pricey add-on for After effects). Basically Element3D allows for realtime rendering of 3d objects which allows people to render animations and vfx far quicker than cycles rendering. Of course the reflections and such are not exact, but often they can fool viewers. Here’s a link if your interested: http://www.videocopilot.net/blog/2015/06/element-3d-v2-2-now-available/

    • http://www.cgmasters.net/ Aidy Burrows

      Hi!

      Yes for some reason that has the look about it that it isn’t the correct build, the official 2.78 release is out now, hopefully you’ll get more joy with that!

      Ah yes, I’ve followed videocopilot from back when there was only a dozen or so tutorials, I’m aware of the element 3d stuff too, yes you’d be able to do some pretty cool stuff with the realtime viewport, I think one of the most powerful combinations out there at the moment is Blender and UE4 working together, though even just within Blender you can get some awesome results. If you can get it working try the experimental realtime cycles branch by Clement Foucault as talked about near the end, that’s a great and fast option and combined with some baking the realism could be REALLY well sold. Especially with an additional pass in the compositor or VSE. 🙂 Aidy.

      Oh plus Mr Foucault will be introducing a lot of his work there into official Blender over the next few months! 🙂

    • Thadeu Luz
      • tysonhh

        Yeah, I’m on OSX. I did make sure I had the most current version of blender, etc. So it must be a mac thing and/or perhaps my lack of a reasonable graphics card. Thanks for the comment, at least I know I’m not the only one.

        • Thadeu Luz

          From what I’ve been seeing it looks like it is an incompatibility with openGL drivers shipped on OSX. I have bootcamp setup and on windows on the same machine, everything works as expected.

          Too bad there aren’t that many blender users on osx

  • Warren D. M. Reed

    Nudge-nudge wink wink say no more Squire! Woooh! Now I don’t have to ask ‘wot’s it like?’! Thanks for this and the breadcrumbs to other links. Blender is more and more unleashed!

  • tofuloh

    Hi, can this pbr shader be used in 3D blender models which will be uploaded for sale?

    • http://www.cgmasters.net/ Aidy Burrows

      apologies for the delay! Yes that shouldn’t be a problem, it should work for all versions of blender now. I think a little bit of knowledge is required to be able to get the most out of it though so I’m not sure i’d want to burden the customer with that, usually simpler the better. At this point i still consider it all a bit experimental. However if you take the cycles shader node group and use that as your materials, and do your previews in the cycles experimental build that may all work nicely.

      That is of course until the new blender 2.8 viewport comes in, the same person who did the cycles experimental realtime build is working on it fulltime employed by the blender foundation, so good things will be coming soon! 🙂

      If you check out our facebook page you’ll see a recent link to the latest code info on the viewport project, it should be great! 🙂

      Aidy.

  • Pivot Point Press

    What is the workflow for creating the maps for the environment wrap. What is the difference between each map?

    • http://www.cgmasters.net/ Aidy Burrows

      apologies for the delay, unfortunately it’s a bit on the clunky side to say the least. I was simply taking a equirectangular map and needed to convert it into a cube map, so i took a glossy sphere that was unwrapped in blender to accommodate an equirectangular map, it’s a fairly standard way of unwrapping a sphere, then I baked the glossy direct at different roughness values on the glossy shader.

      Then I took those baked equirectangular maps, and put them into a blender internal world material and did the usual baking to cubemap procedure.

      It’s a bit hard to follow really I realize, it’s way simpler to just use the cycles experimental build, and we’re not that far from the 2.8 viewport project either!

      https://www.facebook.com/cgmasters/posts/1395784497119608

      That’s something to look forward to! 🙂

      Aidy.

  • Pingback: Realtime PBR in Blender 2.78 | Open 4k