Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / What kind of texture/map are these?

Author
Message
Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 16th Sep 2022 19:05 Edited at: 16th Sep 2022 19:11
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?)

Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 16th Sep 2022 23:05
3 is the texture
2 is the normal
1 is the light
Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 16th Sep 2022 23:27 Edited at: 16th Sep 2022 23:29
@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:

Attachments

Login to view attachments
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 17th Sep 2022 05: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.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)

Donations are always welcome.
Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 17th Sep 2022 05: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?
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 17th Sep 2022 05:44 Edited at: 17th Sep 2022 05:47
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?
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 17th Sep 2022 05:52
Try creating a point light above the plane and SetPointLightMode(light, 1)
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 17th Sep 2022 14:17
Scribble wrote: "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"

Virtual Nomad wrote: "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.

Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)

Donations are always welcome.
Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 17th Sep 2022 17:13 Edited at: 17th Sep 2022 17:17
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.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 18th Sep 2022 22:07
hendron
8
Years of Service
User Offline
Joined: 20th Dec 2015
Location:
Posted: 18th Sep 2022 23:00 Edited at: 18th Sep 2022 23:07
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)
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 19th Sep 2022 03:57
Using your normal map on a plane


Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
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.
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda
Pixel-Perfect Collision

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
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?
hendron
8
Years of Service
User Offline
Joined: 20th Dec 2015
Location:
Posted: 19th Sep 2022 22:08 Edited at: 19th Sep 2022 22:23
Quote: "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.
Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
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?
hendron
8
Years of Service
User Offline
Joined: 20th Dec 2015
Location:
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?







Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 19th Sep 2022 23:44 Edited at: 19th Sep 2022 23:53
@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?
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 19th Sep 2022 23:58 Edited at: 19th Sep 2022 23:58
Looks like this to me

Attachments

Login to view attachments
Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 20th Sep 2022 00: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?
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 20th Sep 2022 01:10
Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 20th Sep 2022 01: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.
hendron
8
Years of Service
User Offline
Joined: 20th Dec 2015
Location:
Posted: 20th Sep 2022 01:45
Quote: "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).
Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 20th Sep 2022 05:01 Edited at: 20th Sep 2022 05:02
@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.
Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 20th Sep 2022 05:11 Edited at: 20th Sep 2022 05:13
@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:
Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 20th Sep 2022 08:10 Edited at: 20th Sep 2022 08:17
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
hendron
8
Years of Service
User Offline
Joined: 20th Dec 2015
Location:
Posted: 20th Sep 2022 14:30 Edited at: 20th Sep 2022 14:31
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.






Quote: "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?"


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.
Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 20th Sep 2022 21:41 Edited at: 20th Sep 2022 21:52
@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)

Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 20th Sep 2022 22:46 Edited at: 20th Sep 2022 22:56
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:



Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-26 08:38:43
Your offset time is: 2024-04-26 08:38:43