Before updating to Windows 10 you may need to return your Pro license. More information here

Invisible block, Visible outline

The question of the hour is: How to make a transparent block with a visible outline? I am trying to make a platform who's outline is visible and it can't be stepped on. upon flipping a switch the block becomes solid. How can I make it invisible, but still have an out line? I've seen some solutions using shaders, but I have absolutely no clue how to manipulate that code. Or how I could turn it off when hitting a button. Any ideas?

more ▼

asked May 22, 2012 at 04:12 AM

avatar image

107 112 103 106

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

A quick way be to just make a 32x32 image with a transparent background and a thin border (2px on mine) around the edges. Then make a material (transparent diffuse shader) and use that image for the texture. Then your box is transparent with a border. When looking 'through' the box, you won't see the other sides border's. Only see the borders on the outside of the box.

more ▼

answered May 22, 2012 at 11:37 AM

avatar image

7k 6 25 59

I tried making a texture in photoshop, the top layer being a dotted line for the outline, then the 2nd layer behind that had 0% fill. I added it to a transparent diffuse shader but the box still had a white fill on the face facing the camera, then a semi transparent for all the others, I can see inside the cube but I can't see through the cube. Any thoughts on that?

May 22, 2012 at 10:25 PM easilyBaffled

Don't know. Worked fine for me.

May 22, 2012 at 11:38 PM Lo0NuhtiK

How did you make the initial image?

May 22, 2012 at 11:50 PM easilyBaffled

Used GIMP, made a 32x32 image with transparent background, then lined the edges with 2px color border. Exported as .png .

May 22, 2012 at 11:51 PM Lo0NuhtiK

So is it on 2 Layers or one?

May 22, 2012 at 11:59 PM easilyBaffled
(comments are locked)
10|3000 characters needed characters left

You can try to use Alpha mask. For example, render your mesh with ColorMask A and Blend One Zero, then render the same but slightly scaled with ColorMask RGB(A) and Blend DstAlpha OneMinusDstAlpha.

more ▼

answered May 22, 2012 at 03:05 PM

avatar image

31 8 9 9

Based on the number of things in here that I didn't understand, it sounds like it could work. I'm going to assume this has to deal with writing a shader script, as of yet I have no clue how to do that, I am looking that up now. And not that I want to be spoon fed, but, could you please provide a slightly dumbed down example?

May 22, 2012 at 10:27 PM easilyBaffled
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

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



Answers and Comments



asked: May 22, 2012 at 04:12 AM

Seen: 2125 times

Last Updated: Feb 18, 2014 at 09:25 AM