Tuesday 22 September 2009

I'm a Material Boy

Sorry for the long period with no tool show off. Blogging sure takes time :P

Here's the HPL Material Editor, our latest addition to the tool suite. This is what we use to create, edit and preview materials with. In a nutshell, a material is what's gonna determine how an object is going to look like in the engine. As of now, we have three basic types of materials:
- SolidDiffuse, which we use to model solid surfaces. Take a bit of a bump map, and another bit of a heightmap and you will have a more than convincing rock like material for example :)
- Translucent, to create a "glass like" look - Windows, ice... transparent stuff falls in this material type.
- Water, the most bleeding edge feature in the engine right now, used to simulate "liquid objects". Just like water in Penumbra, but now with more Reflection(tm).

Of course, it wouldn't be a HPL2 tool if it hadn't a realtime preview window, which is what really makes the tool worth it. In the good old Penumbra days, one would have to edit the material using the HPLHelper app, but then testing how the material looked meant having to start an independent viewer program, a bit of a pain if you ask me. The preview window features cubemapped and flat colored background, different preview models (ie cube, cylinder, sphere and plane), and lighting with customizable colors.

And last, but not least, here's a little video showing the Material Editor in action, in standalone mode (yeah it is also integrated in the other editors)

By the way, that "blackness" artifact at the edges of the water plane are caused by the current preview window setup. Looks like I'm gonna need to fix that... :P


  1. Wow, that looked pretty cool...the water reflection needs some refinement (as you stated), but other than that, it looks like pure, unadulterated awesomeness right there. Sometimes, it's the minor little details that can really add to the immersion...and making the stone pop out at you like that definitely helps!

    I've got a bit of a historical question...I don't know who was involved with the "Unbirth" project (Thomas, I know was...) but I'm curious to know the techniques that were learned, or refined, by making textures for that old relic. I noticed similiar light illusion effects in Unbirth as the ones displayed here...has anything changed since then?

  2. Unbirth used normal mapping too, but at that time the engine was not internal and made by another guy. Starting with Penumbra I begun the work on the HPL engine and took what I had learn in terms of engine design and such from the work with Unbirth and put that into the engine.
    When working on Unbirth I only had a very sketchy understanding of how the lighting calculations worked and did not start to dig in to that until later after leaving Unbirth.
    I think that the major I took away was the very cumbersome way of setting up materials that the "Unbirth engine" used and wanted to have something really streamlined and simple. That started out as the basic mat files present in Penumbra Tech demo and has now turned into the material editor.

  3. Those texture effects are a really nice improvement to the engine, with the heightmap it looks great! The editor looks great too! :)

  4. That's not a heightmap, that's a deformation (?) map! Either way, engine is looking many times better than I ever thought it could.

    Love the texture animamations, too!

  5. It is actually a heightmap, it's needed by the parallax mapping shader to work :)
    Thanks for the comments by the way!

  6. Really? I thought heightmaps told vertexes what height they would be. Damn you programmers, quit using the same word!

  7. Yeah, that's another use for them, but that one in particular requires more geometry in order to produce good results. The effect you can see in the video is based on tricking the eye into believing there's a more complex surface in there, when there's not.
    A heightmap is just data, you can use it in whatever way you fancy (as long as it makes sense, that is) ;)

  8. "Height map" is just the name of the texture and in this case it is used for parallax mapping. What you are thinking of is:
    Which also uses height map as input (often also a normal map). So map=input, mapping =the technique used :)

    Another interesting bit is that the effect shown is a really simple version of the parallax mapping does not work at steep angles and does not occlude. The engine contains a more sophisticated algorithm too, but that one is turned off since it is too demanding.

  9. Oh, I see Luis managed to post before me :P

  10. What kind of "animation mode" texture you support? :)

  11. igroman14:
    We have uv-coord animation, which is basically rotation and/or translation.

    We also have frame based animation, so u can have X number of textures that are looped at a certain frequency.

  12. Ok, thank you)


Note: only a member of this blog may post a comment.