Jump to content

Decals


SlipperyBrick
 Share

Recommended Posts

Yes it is application specific. Until today had never seen an 8bit representation of the alpha channel in a png as i do with say a targa. I did a bit of reading and photoshop is specifically hiding the alpha channel in png’s

 

From the adobe help desk., Transparency and alpha channels and png

 

PNG does not support arbitrary alpha channels like other formats such as TIFF. PNG specifies that the fourth channel in a file is transparency, and only transparency. When you open a PNG file with transparency in Photoshop, it is considered a single layer image. It is not a flat background image. Alpha channels can contain anything, while transparency is a specific channel relationship. You can have multiple alpha channels per document, but only one transparency channel. Photoshop handles transparency and alpha channels separately.

 

That doesn't make any sense. A PNG can contain whatever it wants. The compression scheme is purely an algorithm on multichannel data (probably designed to better compress RGBA, but that's not a limitation). For example, in the early days of GPGPU computing, textures were used to perform non-graphics calculations. It's Adobe's fault if they want to handle a PNG like that. They probably mention TIFF because they have business interests in that format lol. But even that format seems to have the same bit-depth, so they would have to be dividing a channel or doing some weird math. I haven't used Photoshop so I don't really know the difference between single-layer and background image. Anyway, I think this is the technical reason why Photoshop and Leadwerks both have issues importing some types of compressed PNGs:

http://graphicdesign.stackexchange.com/questions/5888/why-cant-photoshop-properly-open-this-png

 

I actually didn't even notice this problem until this texture came around.

 

@ScrotieFlapWack

Sorry wrong texture. Open it up in Paint.NET or something and resave it. The encoding is probably not handled correctly by the Leadwerks importer, and this is probably the same issue that Photoshop faces.

  • Upvote 1
Link to comment
Share on other sites

I'll try GIMP haha

 

EDIT: Just reporting back here haha. So I opened up my texture in GIMP and exported out as a .PNG and then imported that in to Leadwerks. As Nick said, I changed the compression type to DXT3 and it worked!

 

I don't know if this is worth doing a bug report because I don't know where the problem truly lies. Plus not a lot of users may use Substance Designer, it kinda sucks cos I was planning on using Substance Designer a lot on majority of my textures :(

Link to comment
Share on other sites

Just a screengrab of the problem fixed.

 

EucCdbL.jpg

 

I think I will put this as a bug report so it can get Josh's attention.

 

No sign of the normal map on the material though, don't know if this is because the Blend mode is alpha, I did test it without alpha and put it back to solid but still no sign of the normal map.

 

Thanks for the fix Nick!

Link to comment
Share on other sites

No sign of the normal map on the material though, don't know if this is because the Blend mode is alpha, I did test it without alpha and put it back to solid but still no sign of the normal map.

You must have the wrong shader picked then if the normal is not showing up.

Using your textures, here are the settings I used for the textures and material:

Diffuse and Normal textures:

post-14-0-12106000-1455386167_thumb.jpg

Decal Material:

//Leadwerks Material File

 

blendmode=1

castshadows=0

zsort=0

cullbackfaces=1

depthtest=1

pickmode=0

depthmask=1

diffuse=1.00000000,1.00000000,1.00000000,1.00000000

specular=0.501960814,0.501960814,0.501960814,0.501960814

alwaysuseshader=0

mappingscale=1.00000000,1.00000000,1.00000000

drawmode=-1

 

shader="Shaders/Decal/diffuse+normal.shader"

texture0="./damage001_diffuse.tex"

texture1="./damage001_normal.tex"

 

Results:

post-14-0-50210600-1455386881_thumb.jpg

 

Keep in mind low lit areas the normal will be hard to see.

  • Upvote 1

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...