Jump to content

[Solved] FADE IN/OUT on OBJECTS...


Russell
 Share

Recommended Posts

Hello there team!!
I am developing a small secret area in my game, and it would be very useful to know if it is possible to make an object disappear using a FADE OUT effect.

Right now, as you can see in the this teaser, my object (a canvas that we have painted) suddenly disappears using a horrible LENS FLARE effect i've putted there.

I don't like it, but If I can make it disappear slowly with a FADE OUT effect without using the LENS FLARE, so much the better.

I've been checking the following thread:

 

But I don't know how use it with an object.

Any idea, tip or suggestion that I can start from???

Thank you very much!!

  • Like 1
Link to comment
Share on other sites

Hi Russel,

There is a super cool shader for this:

Maybe it is not for your purpose, so just check it..

If not, there is a possibility to create an alpha material and downgrade the alpha value to make the object disappear.

Don't forget to remove the shape ;) when disappeared.

 

  • Like 1
  • Thanks 1

 

 

Link to comment
Share on other sites

1 hour ago, Marcousik said:

Hi Russel,

There is a super cool shader for this:

Maybe it is not for your purpose, so just check it..

If not, there is a possibility to create an alpha material and downgrade the alpha value to make the object disappear.

Don't forget to remove the shape ;) when disappeared.

 

Many thanks Marcousik!! I will try it and tell you the results.

Link to comment
Share on other sites

Ohhhh!! Cool!!!

Following your steps in that Thread Marcousik and the original by Shadmar, i have made it with the crawler model...

20201003125809_1.thumb.jpg.38172a40838db6e2142d08700f786a98.jpg

But now i need do this to a SIMPLE BOX with a specific texture... (The box with the texture that dissapear in the teaser)

I will try it now and tell you the results, since now I cannot use the UPDATEPHYSICS function in my case with the box.

Link to comment
Share on other sites

Ok... It's a very cool shader, Works ok with models (i've made success on a Crawler, a car and a TV) but i don't know how use or make it works on simple boxes with simple textures.

For this reason i will try this second idea:

2 hours ago, Marcousik said:

If not, there is a possibility to create an alpha material and downgrade the alpha value to make the object disappear.

I have made an alpha material with the texture...

AlphaMat.thumb.jpg.6ba268725075053830850b965aea47d2.jpg

Now I have to investigate how increase or decrease the alpha value using a script.

Link to comment
Share on other sites

? Nothing!! I don't know how achieve this in my work using one of two given ideas...

It will be cool use Shadmar shader of DISSOLVE effect, works great on all of my 3D models...

But i need to use it only on simple boxes with a simple texture... I don't know how make this successful...

The only idea i've got is model a simple box in 3DS and import it to Leadwerks, and use it with dissolve shader...

It's the only thing I can think of. There has to be some way to do it with a single box.

Link to comment
Share on other sites

I search for this, because I worked on this in the past...

And I found something for you: I wrote a similar shader that works on boxes. For sure I wanted to make something similar but not only on animated models. No importance, look here:

And here are the files:

- The shader: use this for the shadow shader too

diffuse+normal+specular+dissolve-NoAnim - Kopie.shader

- The script you have to put on the box:

Dissolve.lua

 

Give it a try, put a box with a material, give the material the right shader here uploaded, and put the script on the box.

Look that the material has 3 diff+norm+spec textures, because the shader is based on this one.

And you have to put the path of the used material for the box in the start of the script !!

PS all crédits to shadmar.. All I did is a conversion or maybe just nothing. 

  • Like 1
  • Thanks 1

 

 

Link to comment
Share on other sites

7 hours ago, Marcousik said:

Give it a try, put a box with a material, give the material the right shader here uploaded, and put the script on the box.

Look that the material has 3 diff+norm+spec textures, because the shader is based on this one.

And you have to put the path of the used material for the box in the start of the script !!

PS all crédits to shadmar.. All I did is a conversion or maybe just nothing. 

I love you man!! And Shadmar too!!

Many many many thanks!!

I have spent all day testing and changing the original shader of the dissolve models, and I have not achieved anything.

With your files this is the result:

20201004061902_1.thumb.jpg.84f7f5a7abe0fcb10439d4e2d81ef019.jpg

Works great for me!!

Now i must modify the script fot play the Dissolve effect when the Box with the texture appears in the canvas we have paint in the level...

I will tease you the result when i finish it.

Thank you very much Marcousik!!

Link to comment
Share on other sites

  • Russell changed the title to [Solved] FADE IN/OUT on OBJECTS...

Your level just looks beautiful and the idea with the canvas revealing a secret is great, you have the artist touch that is required to build great scenes with simple assets.

Please note that you can change the color of the dissolve effect by changing the last line of the fragment shader:

Quote

    if (NoiseV<InvAlpha+0.025) fragData2 = vec4(1.0,0.0,0.0,materialflags/255.0);    // here change color and width !!!!!!!!!!
 

The 1.0,0.0,0.0 is the color, so this would make a red effect instead of blue.

And InvAlpha+0.025 manages the width so change +0.025 if you need.

  • Thanks 1

 

 

Link to comment
Share on other sites

Just now, Marcousik said:

Your level just look beautiful and the idea with the canvas revealing a secret is great, you have the artist touch that is required to build great scenes with simple assets.

Please note that you can change the color of the dissolve effect by changing the last line of the fragment shader:

The 1.0,0.0,0.0 is the color, so this would make a red effect instead of blue.

And InvAlpha+0.025 manages the width so change +0.025 if you need.

Thank you very much for your words ?

No, blue colour is perfect for the effect, because the blue colour is the last one we must find across the map and use it for reveal the secret area.

In any case, if necessary, I would change it to white as a reference of using the RGB colors. But for now the blue color is cool to me as it looks.
Many thanks!!

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