[SOLVED] Normal map. OpenGL or DirectX?

I would recommend combining Glossiness, Metaliness, Ambient Occlusion and Height into one texture with each channel per type of texture. Or any other combination you feel there is a fit.
There is a pattern in Editor, we do recognize certain types of postfixes on textures, for example: gmao - when you apply such texture on empty slot in material, it will auto-bind: gloss, metaliness, ambient, opacity - automatically.
It is good practice to reduce number of textures, saving VRAM and reducing download size.

As well, use Ambient Occlusion on models, it makes big difference: https://developer.playcanvas.com/en/user-manual/graphics/lighting/ambient-occlusion/

Oh wow, that’s genius! So just to recap. I set it up like this, and the gmao-suffixed texture will represent 4 textures in on RGBA texture?

I guess a black and white texture is smaller than an RGBA though, so will this really save much?

JPEG does not have black and white colorspace formats. And PNG does but in GPU it is still RGB8 or RGBA8.
So yes, it makes huge difference, plus instead of 4 network requests you get only one, which makes big difference on loading times for high-latency cases (when your server is far from user).

And for Normals, you usually want them as PNG, and it makes sense then to put Heightmap into A channel, to save VRAM and another network request again.

So many great optimization tips, THANK you Max!

But PNGs for everything is not a great idea then?

I actually prefer TGA’s :slight_smile:
When you upload TGA, if it has no alpha channel, it will result in JPG, but when you add compression to it, it will make compressed textures from original TGA, which won’t double the compression artifacts (when done from JPEG without TGA source).
If TGA has alpha, then it results in PNG. For normals and glossiness I do recommend PNG, for the rest JPEG is fine most of the time.

If I wanted to combine Normals + Height into a RGBA TGA that transforms into a PNG map then, what suffix would I have to use in order for playcanvas to pick it up correctly?

Btw, I did a RGBA _gmao texture in TGA but it got converted to a JPG in playcanvas and I’m not getting the automatic assignment of channels anymore.

There is no prefix for this case, just manually apply same texture on normals and height, and choose channel for heightmap.

When uploaded, it should convert it to PNG in same folder. Which if you apply on empty slot, will do auto binding. Although you can manually set same texture on different slots and don’t forget to choose right color channels by the slots.

Cool. I wasn’t aware of the manual channel setting. However, my TGA does turn into a JPG, not a PNG.

https://www.dropbox.com/s/d410xiwpg0focxr/Mixer_Remesh_LOD1_SimplygonMaterial_gmao.tga?dl=1

Hey, thanks for this. Very helpful!
Quick question…How are you changing the texture settings in Substance to be Metal / Gloss, rather than Metal / Rough (which is the template)? Or are you just inverting the roughness map once it’s been generated?

There are options for exporting gloss maps from Substance. Just go into the “Export document configuration” settings:

I’m almost done with this project, but it ended up at 120 MB. Seems kind of hefty, and I would love to get it down. Most textures as done like you suggested @max,

  1. One JPG for Diffuse
  2. One PNG for GMAO
  3. One PNG for Normal.

Most of them are 2048x2048 and I have 7 materials. That is 21 textures in total. The PNG’s weigh in on around 2-3 MB but I’ve also added all the compression flags like so:

See any low hanging fruits for optimizing size/download speed?

Regards

  • Björn

Silly question, do you need the textures to be 2K? Can they be resized to 1024 x 1024 with losing too much detail?

Hi yaustar, not silly at all.

I’m not sure. I think so, Their painted in substance painter and to get somewhat nice detail I think I need them that large. They do cover large geometries. However, perhaps I could see if a smaller normal map would suffice. perhaps leave the diffuse the biggest one.

Once you have the textures in your project you can use the Compression options to reduce the size of the project when it’s in a build:

https://developer.playcanvas.com/en/user-manual/assets/textures/

Bottom of the page,

I have been sticking to just the PVR option at 2 bits to get a project to work in iPhones (it works well on PC and Android too using them) if you check off all the options the build is a bit large. takes a while to compress all your textures, but once done the Vram usage drops a lot!

Ehm sorry to ask, but i can’t find compression option nowhere…where is it?

It’s a paid or organisation plan feature (can’t remember which).

Both personal and organisation , it’s not a part of free from what I remember. Moved on from free my first day :slight_smile:

1 Like