Posted: 20th Sep 2022 1:10
Storing data in an image
Posted: 20th Sep 2022 1:40
@blinkOk
Ah yes, thank you.
I've found some online tools that can isolate channels from images, but no tools to recombine them it seems,
so I was thinking maybe I'tll be easier to 'convert' these textures using AppGameKit image-memblock manipulation instead.
Posted: 20th Sep 2022 1:45
So just to confirm, that .gif had no bump/height-mapping whatsoever, right? Only base, normal, and specular map?

Right, no height map. I'm guessing that the R channel in image 2 might be used for height map based on the name (hnm), but it could just be blank (at some default value) in this particular material. There is also what I believe to be an AO (Ambient Occlusion) map in the R channel of image 3, which I sort of simulated in the shader graph by multiplying (scaling) the base map with it. Specular map defines the intensity of the specular highlights while Roughness defines the sharpness (IE how mirror like the specular highlights are. Darker areas = smoother, lighter areas = rougher).
Posted: 20th Sep 2022 5:01
@hendron
Regarding the R channel of 3.png (which you suspected as AO that you've simulated in the shader graph by multiplying (scaling) the base map with it) ,
how do we simulate that in AppGameKit?
Do we just scale the SetObjectColorEmissive( objID, red, green, blue ) with that R channel value to artificially increase/decrease the emissiveness?


@blinkOk
yeah, it looks kinda like that, like everything became dark.
I begin to suspect that the normal map was never meant to be used alone. Maybe it must be used with the accompanying specular and adjusted diffuse map brightness to produce the final intended bright-enough sheen the .gif hendron posted before.
Posted: 20th Sep 2022 5:11
@hendron
Also, I've just converted the 2.png channels into their 'correct' channel, as illustrated by your previous blender diagram:
-green converted to red
-blue converted to green
-alpha converted to blue
-red converted to alpha (unused)

Can you try to plug in this texture as normal map in that blender scene you've made? This time, just leave out the alpha (unused channel), but plug in other channel to their respective names.
I want to see if this is the correct conversion, but I can't use speculars reliably in AppGameKit yet, so can you try it on your blender scene?

The converted 2.png:
Posted: 20th Sep 2022 8:10
Thanks to you guys, I've had some ?success? getting in specularity using those textures in AppGameKit (Janbo's dual parabolic specular shader).
Still need to tweak lots of things, several things doesn't seems quite right, for example the object looks kind of ?yellowish? But it's getting there I guess

Oh right, for specular texture, I just change all of the channel color to be same value as blue (except alpha which was set to 255 opaque) to form a black/white texture.
Don't know what to do with the unused R,G,and alpha channel, can't find a place for them in Janbo's shader pack.
Not sure how to implement roughness texture using Janbo's shader. I'll take a closer look at his SSAO shader to see if there's input room for textures.
Any tips to improve on these things will be appreciated.




specular texure
Posted: 20th Sep 2022 14:30
Ok so I've messed around with it a bit more. I'm no shader expert, just fyi, so it really is just some assumptions on my part. From what I can tell, the normal map (image 2) seems to be using only the Green and Alpha channels for actual data. The Alpha channel looks to store the X (horizontal) coordinates while the Green channel stores the Y (vertical) coordinates. Meaning you'll want to use Alpha for Red, Green for Green.

You would think the Blue channel would represent the Z (depth) coordinate, but it is set to a mid-gray tone all over, giving the normal map a grayish hue that doesn't look right. I'm guessing that the shader this image is made for doesn't actually use the depth channel in the image, or does something unusual with it (again, I'm no expert so I don't know). Either way, discarding the blue channel from the image and simply using a fully bright source for the blue channel of the normal map makes it look much more like a proper normal map to me, and it looks right when used in the standard blender shader (see gif).

I've attached the normal map (baked from Blender) as well.






ow do we simulate that in AppGameKit?


I'm not exactly sure it's possible out of the box. I'm pretty certain you would need a custom shader setup to take full advantage of this material. I haven't used Janbo's shaders in a while (honestly I don't use AppGameKit for any kind of modern 3D stuff as I find it to be a pain for that, lol), so I don't remember if they support Roughness or AO maps.
Posted: 20th Sep 2022 21:41
@hendron
Appreciate the further testing. Yeah, the normalmap I was using for that screenshot also had its blue channel ramped up, by setting the channel to 255 (?max color?). The grey normalmap I posted are just not blue enough. I initially thought the blue channel was supposed to be achieved by combining the unused Red and Alpha channel, but in the end it just capped out at 255.

This is a new normalMap I tweaked using your new format. It does look better than previous format.
But for some reason it looks darker than your normalmap texture? lol
Alpha converted to Red
Green stays as Green
Blue set as Blue 255
Red converted to Alpha (but set as 255 to make the map opaque)

Posted: 20th Sep 2022 22:46
Looks pretty alright in a scene too, when all of them textures combined together. A bit muted, need further tweaking on specular strengths and lights: