miércoles, 13 de marzo de 2013

SSBumpmaps

Long ago I remember writing in Twitter something about me experimenting with Self Shadowed Bumpmaps, a feature in the Source engine that was released back with the Orange Box, since then all following Valve games have included them, and just a couple of days ago I found my old files and started doing more tests with them, so here will write a little of my knowleage about them, hope you will find some of it useful.

Ok so as some of you may already know to create a regular "Normal" Map or "Bump" Map there is the need of a height map, for Self Shadowing Bump Maps (SSBM from now on) those are also needed.
Unless! you have already a Normal Map that you want to convert over, now, Valve gots a set of command line tools to make both actions, "height2ssbump.exe" and "normal2ssbump.exe" respectively, you can see plenty of documentation about those in the Valve Dev Wiki,here I will talk about neither of those since I don't use them because of their lact of GUI, but I bet they can be useful to handle large amount of textures in batch ways.

The tool I use, and recomend you to use it, is the free tool called SSBump Generator, you can grab it from here: http://ssbump-generator.yolasite.com/ here is a mirror in case it's down.

Ok, so let's start, here it's the texture we will be creating the SSBM:



It's a HL2 texture, "props/metalcrate001d"

So, let's create a Height Map that works for that texture, I will suppose you know how heightmaps work(dark is low, white is hight), there are multiple ways to create them, you can use the base texture in grey tones and then go from there, when it's something sharp like metal I tend to recreate the texture in vectorial for a better more clean thing. There are also ways to create them with 3D tools like 3DMax or Mudbox, but I will leave that to you to learn how to do that.

Here it's the heightmap I created:


So now that we have that we go to the SSbumpmap generator's regular Bump map generator(wich is also pretty cool)



Load the heightmap, create a new layer and check how it looks:


Looks a bit boring, the real trick for a good SSBumpmap is to have a good Bump map to start from!

So let's make it sharper, let's add a Fine Detail layer on top:



Ok, it's better now, let's say it's perfect.
Now we can convert that bumpmap to a SSBumpmap:



So.. we now have this SSBM that works as regular bumpmap..
But there is something missing here.. come on, it's in the name.. you should know it.. ok, it's the shadows!

Here is the trick, you need to open the bumpmap you created before in an image editor soft and add an alpha channel to it, that alpha channel is the heightmap(can be the same or another), the one that will be used to cast shadows in our SSBM, so we do that, and now we repeat the step before but change this first:


So now it will take a bit longer, and so we got this:



The ray caster now generated this Ambient Occlussion that goes right on the texture, this is how those shadows alone look:


This effect can be made stronger, just play a bit with the sliders.

And that's it, now you have your SSBumpmap, then you can do other stuff like add an alpha channel to it to use it like a specular mask and then create the VTF with vtex.exe or VtfEdit.

Here it's how it looks without the SSBM and later with it:


Here some wisdom:

* Don't Use SSBumpmaps on floors unless it's complex terrain or the game uses a lot of low light sources with very closed angles like flashlights, else they will be not noted.

* The heightmaps for the shadows cast should be always clean, only big stuff, you can leave the small details to the heightmap you used for the bumpmap, for example:



There I overlayed another texture to the main texture and then overlayed a new normal map on top of the one we previously did, but didn't touch the heightmap that had that normal map so the shadows created by SSBM generator will not change.
* You can have only shadows(Ambient Occlussion) SSBM.

* If you material gots specular, don't abuse of Shadows, they will also deform the reflexes with potentially unwanted results, to address that you should keep it in mind when you are creating the specular mask to avoid the areas with shadows, or eliminate the shadows completelly, thou, if doing so, there is no longer a point in using a SSBM so you should stick to use a regular Bump Map instead.

* Here it's an interesting article made by Valve explaining how they work: SIGGRAPH2007_EfficientSelfShadowedRadiosityNormalMapping.pdf
Wan't the short version? ok, Regular Bump maps have 4 light sources in 2 channels, red and green, the blue one is for AO, rarelly used, SSBM have 3 lightsources with "baked" shadows in the 3 channels RGB, period.
Ok, that's all for now, just felt I needed to document a bit about this than just telling about it to my friends, also the blog needed some new ink, it's been more than a year since the last post, hopefully will write something much better soonish about Blendtextures, wich are less documented than SSBM.

I leave you with other examples of textures without SSBM and later with them:

martes, 9 de noviembre de 2010

Gotta move that gear up!!!

Debido a los acontecimientos mencionados en la entrada anterior he tenido un periodo de inactividad en lo que respecta a mi mapa, pero he resuelto seguir adelante dado que este problema no parece poderse solucionar de otra manera, así que solo me queda lamentarme por mis juegos perdidos y simplemente comprarlos de nuevo, en cuento pueda.

Por suerte aun tenia mi antigua cuenta de steam, y con algo mas de suerte encontré a alguien(muchísimas gracias Sirillion) quién me "donará" TF2 + GMOD por que hiciera un pequeño trabajo con unos modelos.

Así que en este entretiempo hice estas cosas que pasare a listar, he tratado de ponerlas en el mejor orden cronológico posible.

Primero que nada creé un thread en FacePunch, para ver si alguien estaba interesado en algunos vehículos para ser hechos conducibles, a cambio de que alguien me donara una copia de TF2(si, soy algo pretencioso) por suerte hubo bastante gente interesada, y si bien no todos estaban dispuestos a dame el juego algunos hicieron buenos pedidos los cuales termine tomando en cuenta de todas formas.

De ahí salieron 2 personas interesadas en vehículos, el primero fue alguien pidiendo por algunos vehículos militares, y termino pidiendo, la Van blindada del juego L4D que se puede ver en la campaña "Crash Course", acompañado de un vehiculo(bonus por así decirle) de equipaje que se puede ver en la campaña "DeadAir".

Estos vehiculos ya estan disponibles para ser descargados.

Si tienes VU mod, podrás tener pasajeros y usar las luces en ambos vehículos.

En ese tiempo también alguien me pidió que trabajara en un Warthog de Halo3, un buen proyecto, algo mas desafiante, ya que esté necesitaba bastante trabajo, de textura, animación, caja de colisión(bastante trabajo), y también me esforcé mucho en hacerlo compatible con VU mod, para que pudieran tener tantos pasajeros como se pudiese.


Pero en fin quedo en la nada... el tipo quien quería el modelo me dijo que no podía pagarme a ultimo momento, así que todavía no lo he puesto para descargar, pero esta prácticamente listo, solo necesitaría algún trabajo en los sonidos y nada mas.

Después apareció alguien que me pidió algo distinto a vehículos, el quería que modificara un modelo para hacerlo compatible con un SNPC en GMOD, así que bien, me puse a trabajar en eso:


Realmente me gusto hacer algo como esto, distinto supongo, pero muy parecido al mismo tiempo, de todas formas, lo termine y el me pago con una copia de TF2+GMOD.



Esté SNPC esta para descargar, pueden conseguirlo aquí:

En orden para que funcione necesitan tener previamente Neuroplanes, solo esta disponible vía SVN, simplemente descárguenlo desde esta dirección: http://svn2.assembla.com/svn/NeuroPlanes/

Estos son algunos de los proyectos que mas se destacaron por eso es que he de mencionarlos, además como nunca pongo nada más que de mi mapa en este blog, me sentí obligado a mencionarlos alguna vez.

Aquí les mencionare algunos otros trabajillos que tengo traspapelados, que de vez en cuando les doy algo de atención y los termino:
Algunos vehículos para GMOD que todavía están sin terminar...


Prueba con el auto Stallion, uno de los tantos vehículos que me fueron sugeridos para hacer, tuve que portearlo desde GTA SA, y luego lo use para probar algunas ideas que tenia, como por Ej. creación de colores al azar para cada vehiculo spawneado, un fracaso he de decir, la función de carga de vehículos en gmod se carga una sola vez, así que si se crea partida elegirá un color al azar para todos los vehículos que se spawneen, serán de ese mismo color, también contemplé la idea de usar un Proxy en el material para darle un tinte siempre distinto, pero descubrí que solo se puede crear 1 numero Randon por material, así que solo se puede controlar 1 color a la vez, lo cual solo cambia la luminiscencia del mismo. Resumiendo... = FAIL

Una prueba de los proxies.

Otro vehiculo que estado modificando desde la salida de los vehículos de District 9 incluso antes de lanzar los vehículos de GTA IV, es un Halftrack alemán de la segunda guerra mundial, un buen vehiculo que fue a pedido para un WW2 RP.

Desde entonces he probado muchas cosas con el:


Esta seria una de las ultimas imágenes del progreso en el:



Por ultimo pero no menos importante he estado incursionando en la creación de ítems para TF2(algo simples dado que mis habilidades son bastante limitadas)





Bueno eso creo que es todo, espero haber puesto algo en este blog como para que dure algo de tiempo, en breve prometo poner algo sobre mi mapa, ya que ya he hecho algo de progreso, pero no muy significativo como para mostrar algo.

En cuanto tenga algo concreto y ganas de escribir podré algo, ha ya casi me olvido, si quieren que yo escribá algún tutorial sobre como hacer... determinada cosa, pidan y lo tendré en cuenta ;) COMENTEN!!!