x

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"

Opacity in material that is not masked or translucent

I am trying to create some grass geo and have textures that use opacity to cut out the grass shape on low poly geo. To get that opacity in the engine, I set the material to masked opacity. But that method generally uses the opacity mask to either set that pixel to completely seethrough or opaque depending on the threshold. This gives hard edges around where the texture opacity falls off.

I can use the opacity slot correctly when I set it to a translucent material but then I am seeing though the mesh from some angles and its not the type of shader I want anyway.

Is there a way to have a standard shader (like opaque) but have the opacity slot enabled to allow simple opacity with values in between 1 and 0 for cutting out shapes?

Product Version: Not Selected
Tags:
more ▼

asked Jun 30 '14 at 08:07 AM in Rendering

avatar image

dokipen
31 6 9 15

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

2 answers: sort voted first

Hi dokipen -

There is two things you will probably want to do to achieve the look you are going for and maintaining you opacity mask. The first is to make sure that your texture has an unmatted alpha, this is not just an applied alpha channel, but a process which multiplies up the dim values of pixels along your alpha edge to ensure the correct values get translated into the shader. There is a wonderful tutorial that Bill Kladis does which is free to view on youtube, **here**. You will also want to adjust your clipping value based on the alpha and effect for which you are going.

Masked Materials are always going to be slightly "blocky," but with the two method above you can achieve something which is much better looking in the long run.

Let me know how it comes out -

Eric Ketchum

more ▼

answered Jun 30 '14 at 02:13 PM

avatar image

Lovecraft_K ♦♦ STAFF
36.8k 702 260 736

avatar image dokipen Jul 03 '14 at 10:27 PM

Thank for the link Eric that was helpful. I understand the issue. That bring me to the point now where I think that isn't the problem. The problem is that the static mesh is made out of lots of smaller intertwined cards. Some of the cards at the back are being rendered in front of the front cards. It's not clear how the renderer chooses which pixel to be the final one but I'm guessing that the normal of the mesh decides if it should be seen of not. It's a two sided material. It can be seen clearly when looking at a preview cube in the material editor though. One side of the cube renders correctly when the other three sides renders the back sides of the cubes. Is this expected behaviour with two sided materials?

avatar image Umberto Jul 03 '14 at 11:16 PM

I've encountered this problem as well. I'm guessing that the engine renders the triangles of a static mesh according to how they were numbered in your 3D package? If you used individual sprite card meshes it might work - but would incur many draw calls.

avatar image Lovecraft_K ♦♦ STAFF Jul 04 '14 at 12:56 PM

Hi dokipen -

I think I am confused as to the problem you are having. Can you post a screenshot of your material so I can see exactly what you are talking about?

Thank You -

Eric Ketchum

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

Sure thing.....

As you can see some polygon render in front of others. It's most easily seen in the cube in the material editor where the polygon on the left renders in front of the one behind it on the left but the rear right polygon renders on front. Its just a freshly made material that is translucent, two sided and has slots in emissive colour and opacity

alt text

alt text

grassmesh.jpg (88.0 kB)
more ▼

answered Jul 04 '14 at 01:13 PM

avatar image

dokipen
31 6 9 15

avatar image Lovecraft_K ♦♦ STAFF Jul 04 '14 at 01:29 PM

Hi dokipen -

I think I understand your problem a little better now. For what you are trying to do Translucency may not be the best route to go. I would suggest taking a look on the **forums at Ulrich's grass shader** which works very well and provides a simulated opacity through subsurface lighting but keeps the sorting of a masked material. Many different users have come up with some great answers to foliage shading and have posted in that forum thread.

Thank You

Eric Ketchum

(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