Posted: 16th Sep 2022 19:05
Hello. I've come across some textures, namely 1.png, 2.png, and 3.png.
1.png is supposed to be a diffuse base texture. But I'm not so sure about 2 and 3.png.
2.png looks like a normal map. But the color are all weird, unlike the bluish color of other usual normal maps.
3.png, I think it's supposed to be a specular map, but I though specular maps are black/white colored? Or is this map already 'corectly colored'?

If they are indeed specular and normal map, is there any way to convert them into the 'proper' colored maps?

Thanks in advance.

1.png (diffuse)


2.png (?normal map?)


3.png (?specular map?)
Posted: 16th Sep 2022 23:05
3 is the texture
2 is the normal
1 is the light
Posted: 16th Sep 2022 23:27
@blink0k
I tried loading 2.png using AGK's default normal mapping command
SetObjectNormalMap( objID, imageID )
But the object looks all grey. and not much bumpiness. Comparing the 2.png with other 'normal' normal maps, it seems that 2.png isn't very 'blue' like other normal maps. It might be that 2.png follows some other normal map color formatting. But I don't know what format, and how to convert them into 'normal' format.
Any idea how to make 2.png looks like 'normal' normal map? I tried feeding it into some online normal-mapping generator, but not much luck, they doesn't give the same 'bumpiness' the 2.png seems to suggest it have.

Also I'm pretty sure 1.png is the diffuse texture, since I've seen it's from some other game.
I'm not sure what 3 is. Specular? Light? Or combination of some other? 3.png color gradient seems to follow 1.png wall paint line and stickers closely, so it might be for specularity / shininess of those wall paint line when we view them from various angle.

I'm trying to use these textures in AppGameKit, probably with Janbo's shaders, but they seems to need to be converted to correct coloring format first. Any idea how?

Here's an example of normal map format that works with AGK:

Posted: 17th Sep 2022 5:09
I think 2 is a bump map.
this is different from a normalmap.
You can consider it as a hightmap.
there are online converters that allow you to easily convert it to a nomal map.
like this one for example.
Posted: 17th Sep 2022 5:36
@ MadBit

I see, 2.png height/bump mapping huh. Maybe I should try generating 3D model from that image instead of normal-mapping a plane object.
But i wonder why that 2.png has multiple colors with transparency? All of the heightmap I've seen are black/white.
Any idea about the 3.png?

Oh right, here's their original file name, might help you guys figure it out. Sorry, I renamed them to 1, 2, and 3 after converting them to png. The original file is in .dds format:

1.png = bsm.dds
2.png = hnm.dds
3.png = srm.dds

So,
bsm = ?base?
hnm = height + ?normal? + map?
srm = ?specular? + map?
Any idea on the acronym?
Posted: 17th Sep 2022 5:44
not sure but they may be combinations of 2+ images each as you're suggesting since you really don't need all channels for some, right?

i'd guess there is software out there that does this (for whatever reason) while performing conversions/data extraction necessary internally?
Posted: 17th Sep 2022 5:52
Try creating a point light above the plane and SetPointLightMode(light, 1)
Posted: 17th Sep 2022 14:17
.png = srm.dds

not sure but they may be combinations of 2+ images each as you're suggesting since you really don't need all channels for some, right?


If I had to take a guess. Then I would say.
bsm could be base map (rgb) + specular map (alpha).
hnm could be height (alpha) + normal (rgb). Would explain why there are transparent pixels.
n indicates the direction and h the length (intensity). This is such a shader thing of which I have not so much knowledge.
srm saturation r??? no idea.
Posted: 17th Sep 2022 17:13
I see, thanks for all the insights. Make sense.
I guess these unusual texture format are the result of them coming from a proprietary game engine. Make sense that they would want to use unique formatting for their engine to prevent their assets/textures from being stolen.
Probably for optimization purposes too.

Looks like any conversion to 'normal' texture will need specific tool for this engine which I haven't found yet.
Posted: 18th Sep 2022 22:07
I use crazybump
Posted: 18th Sep 2022 23:00
My guesses:

1. Base/Diffuse
2. Red = Height? Though it seems unused in this texture. Green, Blue, Alpha = Normal
3. Red = Ambient Occlusion, Green = Specular, Blue = Roughness (could be Green = Roughness, Blue = Specular)
Posted: 19th Sep 2022 3:57
Using your normal map on a plane


+ Code Snippet
// Project: normal 
// Created: 22-09-19

// show all errors

SetErrorMode(2)

// set window properties
SetWindowTitle( "normal" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window

// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 )
SetAmbientColor(10, 10, 10)
SetSunDirection(0, -1, -1)

plane = CreateObjectPlane(5,5)
RotateObjectLocalX(plane, -90)
normal = LoadImage("normal.jpg")
SetObjectNormalMap(plane, normal)

SetCameraPosition(1, 0, 10, 10)
SetCameraLookAt(1, 0, 0, 0, 0)
do
	RotateObjectLocalZ(plane, .5)
    Print( ScreenFPS() )
    Sync()
loop
Posted: 19th Sep 2022 15:41
2 wouldn't be just a bump map, there's color in there. Looks more like a normal map to me.
Posted: 19th Sep 2022 21:39
@blinkOk
Yeah, that normal map works wonderful as-is with AGK.
But if I try it with 2.png, or converted to 2.jpg (without transparency), the lighting are all screwy, not appropriate to the direction of light it's facing.
There has to be a 'simple' way to convert the 2.png to usable form. But I'm not pro enough to do that reliably, because it seems that some colors need to be repalced appropriately
Do we need to replace all the transparency with default blue/purple of normal map or something?

@hendron
For 2.png, I thought red is just a intermediate between green and dark blue?
And I thought normal maps didn't use alpha? In 2.png, the transparency covers most of the wall, in the places where it should be 'neutral' blue normal.
But when converted to JPG, we can see that the level of transparency on the middle of the wall skews a little, forming a 'bump'. So maybe transparency in 2.png is for bump/height mapping?
Posted: 19th Sep 2022 22:08
And I thought normal maps didn't use alpha?


Alpha doesn't have to be used as transparency. It's just data and it's up to the engine/shader to decide what to do with it. The engine's shader setup could use the GBA channels as normal map data instead of RGB. Again it's just a guess though.

Edit:
Sorry, I should have read your reply more carefully. I don't think the Alpha in 2 is a bump map because it appears to have directionality to it, particularly on the horizontal axis. If it was a bump map, it wouldn't have highlights and shadows corresponding to a light source coming from the right. It would just be light on the elevated areas and dark on the depressed areas.
Posted: 19th Sep 2022 23:24
Also, is there a bump mapping shaders or projects for AppGameKit that's available for use?
I've noticed Janbo's shaders collection doesn't include bump-mapping. Or did I miss something?
Posted: 19th Sep 2022 23:28
Tried putting together a material in Blender to test my guesses. Seems like it's on the right track?



Posted: 19th Sep 2022 23:44
@hendron
Yep, that's exactly what it should look like! Thanks a lot for the visualizations. That diagram explains a lot.
Maybe I'll try to somehow separate the colors into separate texture map later.

So just to confirm, that .gif had no bump/height-mapping whatsoever, right? Only base, normal, and specular map?
And the 'roughness' attribute, what kind of mapping is it? Or is it just an smoothenings of the normal/specular map?
Because Janbo's shader collections doesn't have bump mapping that me, a plebian can use. And I wonder if the default AppGameKit normalmap shader works alongside Janbo's specular shader?
Posted: 19th Sep 2022 23:58
Looks like this to me
Posted: 20th Sep 2022 0:19
@blinkOk
That reminds me, I seem to recall you (or other person) made an example project on how to manipulate data in image file using memblock, or something similar.
Do you still have the example project? Can you post it here again?