Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Can't add black to material using lerp. Ends up transparent. What's the alternative?

Trying to add a shadow to my masked out moon using the same mask but with an offset. Instead of creating a shadow it makes it half transparent. Now I have floating bananas.

I don't get it, the lerp node asks for an alpha. I just want it to use the alpha to blend, I don't want it to ask for a second opinion from the texture sample.

Any solution?

Changing the shadow colour from black to red yields this result:

Resolved, fixed working moon.

Product Version: UE 4.11
more ▼

asked May 15 '16 at 11:38 AM in Rendering

avatar image

Grant Margison
86 7 15 21

avatar image tbone240195 May 15 '16 at 11:55 AM

Can we see your material?

avatar image Grant Margison May 15 '16 at 12:11 PM

Ignore the yellow, the sun's not a problem.

avatar image tbone240195 May 15 '16 at 12:13 PM

If I look closely your moon has the sun color, and the moon color looks to be used as opacity.

avatar image Grant Margison May 15 '16 at 12:36 PM

The moon is slightly off coloured from the sun, indeed. I just don't think linear Interpolate recognises black as a valid colour to add. Does it?

avatar image tbone240195 May 15 '16 at 12:42 PM

It does, but I don't see where your nodes go to. Also what is the material? opaque? It looks like it's masked or so.

avatar image Grant Margison May 15 '16 at 12:54 PM

It's opaque. It's a standard sky sphere with the exception of the nodes in the screenshots. The material was an unlit material, meaning only an emissive node. I thought to myself, black doesn't emit, maybe that's the problem, so I changed to default lit and there's literally no difference in blending. It's got to be something to do with the lerp's, if I change the colour from black to bright red, it works. Problem is, I don't want a bright red shadow lol.

avatar image tbone240195 May 15 '16 at 01:06 PM

Can you show where everything is plugged in? It's hard to debug without seeing the complete picture

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hope all goes well man, good luck!

more ▼

answered May 15 '16 at 02:53 PM

avatar image

46 3 3 8

avatar image Grant Margison May 16 '16 at 04:46 PM

Linear Interpolation doesn't add black colour from B to A based on alpha, it removes colour from A based on alpha. I was removing colour from the moon only and as a result it looked transparent where the shadow was. I needed to remove colour from the stars as well but not the clouds.

It is a pain in the ass, there's no denying that, I wish I could just say add black to A based on alpha but no. There must be another way.

I any case, sorting the layering out so I was using lerp to remove colour from the moon and stars yielded success. Working with sphere masks for the moon is a nightmare but I ended up getting these results http://imgur.com/a/3j5gI

It's ok, well no It's pretty bad to be honest, it's so bland it doesn't fit with the world, lacking texture.

I think I'm going to try a static mesh instead, offset far away from a centre pivot and just rotate that when I'm rotating the moonlight. Not sure how to go about the Earth shadows on it yet.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question