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"

A part of an object to be translucent partly only


I have a topdown camera, so sometimes some objects (even sometimes the player itself) are hidden behind some other elements - for example, brushes or satic meshes. What I want to do, is to make these objects which are hiding my ones partly translucent - only a part where the actual hidden object is, and not 100% translucent, but say 30% only. All of that at runtime.

It seems that there is two approaches - using a BLEND_mask or a BLEND_translucent materials. But it seems that I would need to use them somehow simultaneously to acheive that. Because I don't want to make the whole object translucent (as with BLEND_translucent), only a small area of it, but I don't want this area to be completely translucent, as with BLEND_mask. Have I missed something which could make a part of an item to be translucent?

Product Version: Not Selected
more ▼

asked Mar 31 '14 at 09:59 PM in C++ Programming

avatar image

51 6 10 170

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

1 answer: sort voted first

You could make the material translucent and modify it's Opacity value on per-pixel basis using some sort of mask rather than a constant for the whole mesh. This way you would get only part of that mesh transparent and to whatever degree you want (for example 30% transparent would be Opacity = 0.7f)

more ▼

answered Apr 01 '14 at 03:51 AM

avatar image

1k 38 13 61

avatar image Evengard Apr 01 '14 at 06:57 AM

Can you give a little more information please? How can I do something like that?

avatar image phoboz Apr 01 '14 at 05:24 PM

Here is a sample material: alt text And the result: alt text

mat.png (106.2 kB)
box.png (290.0 kB)
(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