zi.sb

Guide to Emissive Maps in DayZ

Introduction

G’day,

I thought I would do a quick writeup on how to use emissive maps in DayZ. Please note though that this guide is not all encompassing. It is intended for more advanced users, who at least have some knowledge on RVMATS and modelling for DayZ.

I’ve also uploaded the files for this little experiment so you can dig through them yourself.

[DOWNLOAD]

Before you start

Here is some prerequisite information if you haven't already read it: https://community.bistudio.com/wiki/RVMAT_basics

https://community.bistudio.com/wiki/Super_shader

While these are about arma, it is more or less same same but different.

  • You can also only have one colour per RVMAT/EmissiveMap, but of varying intensity. So you can have a dark red and a bright red area on your map, to simulate fire etc, but you can't have it glow both green and red or any other colour combination.
  • In the beginning there was only darkness

    To start off with we will need to have our model imported into Object Builder, whatever you use doesn't really matter, as long as it is UV Unwrapped and therefore capable of using textures. NOTE: All of this guide is just focusing on LOD 0, all other LOD resolutions should just be treated the same way. You can set up every other LOD how you normally would, the emissive map doesn't care.

    For this example I am just going to create a cube in OB.

    Once I have done that, I am going to save the file, into a project folder on the workdrive (P: in this instance).

    For this exercise I am calling my project folder /tut_emisive/. You should follow standard naming procedure, using your opfec tag.

    In this folder I have called my p3d cube.p3d

    While I am at it, I will also create a data folder. So P:/tut_emisive/data. In that folder I will create a new file, called cube.rvmat

    Now I will open up the cube.rvmat in my favourite text editor, mine being sublime, but you can use whatever you want!

    I will now set up the rvmat as a standard super shader rvmat. This is pretty easy to do, just either steal one from somewhere in the /dz/ folder, or use this one that I have provided for you.

    ambient[] = {1,1,1,1}; diffuse[] = {1,1,1,1}; forcedDiffuse[] = {0,0,0,1}; emmisive[] = {0,0,0,0}; specular[] = {1,1,1,1}; specularPower = 30; PixelShaderID = "Super"; VertexShaderID = "Super"; class TexGen0 { uvSource = "tex"; class uvTransform { aside[] = {1,0,0}; up[] = {0,1,0}; dir[] = {0,0,1}; pos[] = {0,0,0}; }; }; class TexGen1 { uvSource = "tex"; class uvTransform { aside[] = {1,0,0}; up[] = {0,1,0}; dir[] = {0,0,1}; pos[] = {0,0,0}; }; }; class TexGen2 { uvSource = "tex"; class uvTransform { aside[] = {1,0,0}; up[] = {0,1,0}; dir[] = {0,0,1}; pos[] = {0,0,0}; }; }; class TexGen3 { uvSource = "tex"; class uvTransform { aside[] = {1,0,0}; up[] = {0,1,0}; dir[] = {0,0,1}; pos[] = {0,0,0}; }; }; class TexGen4 { uvSource = "tex"; class uvTransform { aside[] = {1,0,0}; up[] = {0,1,0}; dir[] = {0,0,1}; pos[] = {0,0,0}; }; }; class TexGen5 { uvSource = "tex"; class uvTransform { aside[] = {1,0,0}; up[] = {0,1,0}; dir[] = {0,0,1}; pos[] = {0,0,0}; }; }; class TexGen6 { uvSource = "tex"; class uvTransform { aside[] = {1,0,0}; up[] = {0,1,0}; dir[] = {0,0,1}; pos[] = {0,0,0}; }; }; class TexGen7 { uvSource = "tex"; class uvTransform { aside[] = {1,0,0}; up[] = {0,1,0}; dir[] = {0,0,1}; pos[] = {0,0,0}; }; }; class Stage1 { texture = "#(argb,8,8,3)color(0.5,0.5,1,1,NOHQ)"; uvSource = "tex"; class uvTransform { aside[] = {1,0,0}; up[] = {0,1,0}; dir[] = {0,0,1}; pos[] = {0,0,0}; }; }; class Stage2 { texture = "#(argb,8,8,3)color(0.5,0.5,0.5,0.5,DT)"; uvSource = "tex"; class uvTransform { aside[] = {1,0,0}; up[] = {0,1,0}; dir[] = {0,0,1}; pos[] = {0,0,0}; }; }; class Stage3 { texture = "#(argb,8,8,3)color(0,0,0,0,MC)"; uvSource = "tex"; class uvTransform { aside[] = {1,0,0}; up[] = {0,1,0}; dir[] = {0,0,1}; pos[] = {0,0,0}; }; }; class Stage4 { texture = "#(argb,8,8,3)color(1,1,1,1,AS)"; uvSource = "tex"; class uvTransform { aside[] = {1,0,0}; up[] = {0,1,0}; dir[] = {0,0,1}; pos[] = {0,0,0}; }; }; class Stage5 { texture = "#(argb,8,8,3)color(1,0,1,0,SMDI)"; uvSource = "tex"; class uvTransform { aside[] = {1,0,0}; up[] = {0,1,0}; dir[] = {0,0,1}; pos[] = {0,0,0}; }; }; class Stage6 { texture = "#(ai,64,64,1)fresnel(0.4,0.2)"; uvSource = "tex"; class uvTransform { aside[] = {1,0,0}; up[] = {0,1,0}; dir[] = {0,0,1}; pos[] = {0,0,0}; }; }; class Stage7 { texture = "dz\data\data\env_land_co.paa"; texGen = "7"; };

    Once done, it should look something like this

    What I will now do is go down to the bottom of the file, and make a new stage, called Stage8. This isn't normally included, but it is what is required to use the emissive map.

    Making Textures

    So now that we have our RVMAT mostly set up we can start texturing our object. In my instance its just a cube so I am going to quickly make a silly diffuse map in photoshop.

    For this example I will use 1024x1024, but you can use 512, 1024, 2048 or even 4096 if your feeling a bit crazy.

    Here's the diffuse texture. High quality, I know.

    I am going to save this as cube_co.tga, and then use Image to PAA (from DayZ Tools)to convert this over to a paa file.

    Once I’ve done this, I am going to place it in the /data/ folder, next to the rvmat.

    Next I will go over to Object builder and make sure that its all working as its supposed to.

    I select the cube in object builder, press E, and select the .paa file I just created as its texture, hit apply and then ok. (Leave the P:\ part in so you can see it in buldozer)

    Then I’ll load up bulldozer just to check its working

    Cool everything looks good!

    Shedding some light on the situation Now to the fun part!

    So now that I know everything is reasonably set up, I can make my Emissive map. This is a greyscale map where Black (0) equals no emission and white (255) equals max.

    So once again I am going to make an image up, in this case I am just using photoshop, but you can use gimp or, hell, even MS Paint.

    I’ll make a new image, once again in 1024x1024, but this time just in greyscale.

    I’ll make the whole image black, which will equal no gloweyness

    And then I will get out a brush tool or something and draw some stuff in white.

    So you can see that I have written some text with a soft edge brush and a hard edge pencil, this just showcases that the in between colours (greys) have different intensities of colour. I’ve also included an image of a bee (Cheers USGS) just to show that you can get as complex as you want with your emissive.

    Now that I have done this, I will save it as P:/tut_emisive/data/cube_e_co.tga the _e_ part standing for emissive (This is the naming scheme they use in /DZ/)

    Then I turn it into a PAA file once again using Image to PAA.

    I am going to go back over to my .rvmat file, scroll down to Stage8 and place in the path to the cube_e_co.paa texture. (make sure to leave in the P:\ so we can see it in buldozer)

    Now we get to choose the colour we want for the emissive. As stated earlier though: You can also only have one colour per RVMAT/EmissiveMap, but of varying intensity. So you can have a dark red and a bright red area on your map, to simulate fire etc, but you can't have it glow both green and red or any other colour combination.

    Scrolling up to the top of the .rvmat file you can see an array called emmisive. (It has two Ms, no it’s not a typo, now that I look at that I think emissive actually has two S’s in it or something… which means I have been typoing it the whole time….. Oh well)

    Continuing on,

    You’ll see something like this. The numbers basically stand for percentage of RGBA. So 1 = 100% and 0 = 0%, something like 0.53 = 53%. They are in the order of RGBA, so Red, Green, Blue, Alpha. 99% of the time you will be setting alpha to 100% so, put that on one.

    emmisive[] = {0,0,0,1};

    Now we get to decide on a colour, I like magenta so I am going to make it

    emmisive[] = {1,0,1,1};

    This means, 100% Red, 0% Green, 100% Blue and 100% Alpha. It should result in this colour

    NOTE: You can actually push these past 100% for extra brightness, more below

    I hope that all makes sense.

    Once you have done all that, just save the .rvmat and head back over to buldozer.

    Once again, select the object, press E and select the .rvmat file for the material.

    Slap apply and then ok. You can run buldozer and should see your piece of art!

    Not very bright though huh? You can increase the emissive values past 100% and it sorta gives it a more distinctive glow.

    Here is

    emmisive[] = {8,0,8,5};

    I am going to quickly pack it into a mod and see if it works in game. (Remember to remove all the P:\ so it packs properly) It should just pack the same as any other model mod you make!

    Heres how it looks in game

    I hope that gives you a good idea of how to make emissive maps!

    If you have any dramas either hit me up in DMs or Ask on the DayZ Modders Discord

    Me: https://discordapp.com/channels/@me/108535912018771968/

    Modders Discord: https://discord.gg/5FWr9nh