Jump to content

Decals


SlipperyBrick
 Share

Recommended Posts

I have a few questions in regards to decals, there isn't really any documentation on them.

 

Are normal and specular maps supported in decal materials?

 

Would there be any options I need to change in my decal material, such as the Blend mode?

 

What shader do I use for my decal material if it has a normal and specular map, would this be the standard diffuse+normal+specular.shader or would I need diffuse+normal+specular+alphamask.shader?

 

Right now I am trying to project a decal on a wall and the material is set up as a standard material, normal map, diffuse, specular. The shader is all set up for normal and specular inputs.

 

mGMwnXR.png

 

Ignore the big white square tongue.png

 

You can see that there is no normal map or specular map showing on my decal. Here is the material.

 

a9aOG7r.png

 

The blend mode for the material is set to 'Solid'. When I change to alpha nothing happens, when I change to shade my white background on my diffuse disappears.

Link to comment
Share on other sites

You can scale the box down and have it at 0 on the X axis (or whatever axis your wall is point out from). What I can't seem to figure out is how to get the normal and specular map to work with it and also my diffuse has transparency as it is a .PNG file.

 

Inside Substance Designer my diffuse shows as expect but then I bring it into Leadwerks and the transparent background is filled with black.

 

MahDNID.png

 

You can see the last 4 nodes of my diffuse is transparent as I am feeding the my main pattern into the opacity slot of my Blend nodes which acts as a mask.

Link to comment
Share on other sites

Hey Josh,

 

I can't seem to get the AI & Events map. I've searched on the Workshop and can't find it there. I've gone to the tutorials section of the website and there isn't a download available in the AI, Events & Pathfinding tutorial. I've also made a new project through Project Manager and chose Tutorials but it isn't in there either :(

Link to comment
Share on other sites

I took a look at the project and the decals seems pretty straight forward. It must be something I am doing wrong in Substance Designer. What's strange is my ouputs are RGBA yet when I export my .PNG files from Substance Designer it looks fine in a thumbnail and in picture viewer as if there is some sort of transparency there but when I bring it into Leadwerks my diffuse texture has the black background haha. I brought the images into Photoshop and they don't seem to have any alpha channels on them.

Link to comment
Share on other sites

PNG's don't support alpha channels, it uses alpha transparency that is part of the png format.

Are you sure? https://en.wikipedia.org/wiki/Portable_Network_Graphics

PNG supports palette-based images (with palettes of 24-bit RGB or 32-bit RGBA colors), grayscale images (with or without alpha channel), and full-color non-palette-based RGB[A] images (with or without alpha channel).

 

Probably just an error on Scrotum's part or a problem when he exported from SD. Also, he hasn't stated what compression method he is saving the LE tex file. The default conversion is DXT1 which doesn't support transparency. If the inherent example in the AI and Events map, doesn't help then my suggestion is for him to actually post the textures in question.

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

From what little I know about Substance Designer, I'm pretty sure it uses black and white as transparency and opacity, and doesn't actually use the alpha channel. I could be wrong, but it might be something to check, because if there's no alpha channel in photoshop, then something is not right.

Link to comment
Share on other sites

A png uses alpha transparency that is written into the png file but not as an independent channel.

 

You keep saying that but yet I am finding otherwise.

Transparency of image[edit]

PNG offers a variety of transparency options. With true-color and grayscale images either a single pixel value can be declared as transparent or an alpha channel can be added (enabling any percentage of partial transparency to be used).

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

Interesting i do not see the alpha channel. The only way i have ever seen this was with a 3rd party application called SuperPNG many years ago. Can you view the alpha channel of the png attached?

 

ps_png.png

post-444-0-10273500-1455329002_thumb.png

My first Adobe purchase was Photoshop 2.0, CS6 was my last! < = >

Link to comment
Share on other sites

yeah this is weird. hmmm but it shows up in both. I don't know the difference. It looks like your program reads the alpha like it is saved into the color channels where as my programs see it as an independent channel.

post-14-0-48150800-1455329416_thumb.jpg

 

 

EDIT-- granted we are way off topic here - sorry for the derailment Scrot. But in any case as long as I can get a transparency gradient out of a PNG, I will continue to use it. Placing a TGA next to a PNG, and I can see no difference in what is displayed.

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

That one was straight out of substance designer, I always was under the impression png didn't write to an independent channel.

It may not - I cannot for say for 100% certainty as I am far from being a texture format expert. I am just going by what I have seen using the programs I have and what I just read in the wikipedia about PNG that it can have an alpha channel added. These two things seem to support each other.

  • 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

That one was straight out of substance designer, I always was under the impression png didn't write to an independent channel.

 

It depends on the type of encoding for PNG (there are multiple types) as well as the program used to view it. A lot of image formats can vary a bit in their encoding (Paint.NET gives you some options). There are also API limitations, such as if you open a 32-bit .png in MS Paint, it'll be opaque. If you open a 32-bit .png in Paint.NET, then it'll be transparent.

https://en.wikipedia.org/wiki/Portable_Network_Graphics

Link to comment
Share on other sites

Just dropping back in to confirm that Substance Designer does use black and white as mask for transparency. When I export my textures out of Substance Designer and bring them in to Photoshop and check the channels there is no alpha channel in any of the textures I had to add it in Photoshop and even then when I add it into Leadwerks it still has a black background.

 

In Photoshop though I can see there is no background, its completely transparent.

 

Here are the textures.

 

Substance Designer Decal.rar

 

If you open them up in Photoshop or GIMP you should see they have transparency but if you check the channels box there is no alpha channel but in Substance Designer I am specifying my outputs as RGBA.

 

Even if I add an alpha in Photoshop on the textures it still shows up with a black background in Leadwerks. It must be a Substance Designer issue because any grayscale images I bring in to Leadwerks straight from Substance Designer give me and access exception error, I have to open the texture in Photoshop and export it as PNG from Photoshop for Leadwerks to be ok with it.

Link to comment
Share on other sites

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.

My first Adobe purchase was Photoshop 2.0, CS6 was my last! < = >

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...