Jump to content


Photo

3d Invisble Cloak effect


  • Please log in to reply
15 replies to this topic

#1 kaibil

kaibil

    GMC Member

  • GMC Member
  • 119 posts
  • Version:GM8

Posted 06 June 2012 - 06:54 PM

Hello everyone, I would want to know how to create that Invisble cloak effect (Recon cloak in Battlefield 2142, or Cloaked units in Starcraft2 or Starcraft 1) I hav experimented with blending modes and had no success... please someone help?
  • 0

#2 Phantom107

Phantom107

    Graphics Enthusiast

  • GMC Member
  • 2616 posts
  • Version:GM:Studio

Posted 06 June 2012 - 07:35 PM

1. Render scene to surface
2. Render scene in black with the player in white (mask scene)
3. Enable ortho projection, draw the scene surface
4. Using the mask scene as a mask on the original scene render's surface (you can use a blend mode), draw multiple times with a small offset to make it blurry.

The second render is required to have depth sorting on the mask. There's no good way to get around it.
This is a costly effect by the way, use with caution.
  • 0

#3 kaibil

kaibil

    GMC Member

  • GMC Member
  • 119 posts
  • Version:GM8

Posted 06 June 2012 - 09:55 PM

1. Render scene to surface
2. Render scene in black with the player in white (mask scene)
3. Enable ortho projection, draw the scene surface
4. Using the mask scene as a mask on the original scene render's surface (you can use a blend mode), draw multiple times with a small offset to make it blurry.

The second render is required to have depth sorting on the mask. There's no good way to get around it.
This is a costly effect by the way, use with caution.


Wow thanks for the reply, but how would I be able to render in separate parts?
  • 0

#4 Phantom107

Phantom107

    Graphics Enthusiast

  • GMC Member
  • 2616 posts
  • Version:GM:Studio

Posted 06 June 2012 - 10:07 PM

You render to different surfaces in the step event. The resulting 2D images should then be drawn on the actual screen in the draw event.
  • 0

#5 kaibil

kaibil

    GMC Member

  • GMC Member
  • 119 posts
  • Version:GM8

Posted 06 June 2012 - 10:17 PM

sorry, but you could you please explain how this would be done in the Step event? (like a simple code example?)
  • 0

#6 TheSnidr

TheSnidr

    That guy

  • Global Moderators
  • 2472 posts
  • Version:GM:Studio

Posted 06 June 2012 - 10:31 PM

See if this can help:
http://gmc.yoyogames.com/index.php?showtopic=520724&st=0&p=3839447&fromsearch=1&#entry3839447
Posted Image
Notice the image to the right
  • 0

#7 kaibil

kaibil

    GMC Member

  • GMC Member
  • 119 posts
  • Version:GM8

Posted 06 June 2012 - 11:36 PM

could it be done with animated textures?
  • 0

#8 Arsanthania

Arsanthania

    GMC Member

  • GMC Member
  • 39 posts
  • Version:GM:Studio

Posted 07 June 2012 - 01:49 AM

could it be done with animated textures?


Should be. If I'm not mistaken, these systems effectively grab a screenshot of what they're looking at, which would mean that they grab anything that is animated as well.
  • 0

#9 Gamer3D

Gamer3D

    Human* me = this;

  • GMC Member
  • 1620 posts
  • Version:GM:Studio

Posted 08 June 2012 - 12:09 AM

could it be done with animated textures?

Depends on what you mean and how good you want your effect to be.

You could fade to a transparent, faintly glowing (Possibly animated) texture. This is rather obvious, but doesn't require rendering to a texture.
You could render the background to a texture and use that. This is possibly the best way to go about it.
  • 0

#10 Phantom107

Phantom107

    Graphics Enthusiast

  • GMC Member
  • 2616 posts
  • Version:GM:Studio

Posted 08 June 2012 - 08:04 AM

Simply fading away the texture won't solve this. GM8 still uses DirectX8, which will cause the depth buffer to mess up when you start drawing transparent things. The drawing order of certain triangles will get messed up.
  • 0

#11 Gamer3D

Gamer3D

    Human* me = this;

  • GMC Member
  • 1620 posts
  • Version:GM:Studio

Posted 08 June 2012 - 10:11 AM

Simply fading away the texture won't solve this. GM8 still uses DirectX8, which will cause the depth buffer to mess up when you start drawing transparent things. The drawing order of certain triangles will get messed up.

That can usually be solved by partially sorting by depth. (Only transparent objects need sorting)
Something to note: Some sets of polygons may require subdivision for proper sorting. For efficiency, it's usually best to ignore this; these cases are rare and usually difficult to notice. In the case of GM, drawing polygons individually is too slow, so sort models, not polygons.

Anyway, my point was that different invisibility effects can be acheived using different amounts of effort and processing power.

The currently popular invisibilty effect is distortion. This would take rendering to texture and, for efficiency, shaders.
The cheap option is to simply make the object mostly (or fully) transparent. If I recall correctly, this (with a lightning texture during transitions) was used by Command & Conquer: Renegade.
Another option is blurring. Again, render to texture. No shaders needed for this though.
Another is to render the previous frame where the object is. (Again, render to texture, no shaders)

Of course, there's no current device to grant full visible-spectrum invisibility, so just make something up. If it doesn't look bad, it'll be fine (You're only going to see if briefly, after all).
  • 0

#12 kaibil

kaibil

    GMC Member

  • GMC Member
  • 119 posts
  • Version:GM8

Posted 09 June 2012 - 02:25 AM


Simply fading away the texture won't solve this. GM8 still uses DirectX8, which will cause the depth buffer to mess up when you start drawing transparent things. The drawing order of certain triangles will get messed up.

That can usually be solved by partially sorting by depth. (Only transparent objects need sorting)
Something to note: Some sets of polygons may require subdivision for proper sorting. For efficiency, it's usually best to ignore this; these cases are rare and usually difficult to notice. In the case of GM, drawing polygons individually is too slow, so sort models, not polygons.

Anyway, my point was that different invisibility effects can be acheived using different amounts of effort and processing power.

The currently popular invisibilty effect is distortion. This would take rendering to texture and, for efficiency, shaders.
The cheap option is to simply make the object mostly (or fully) transparent. If I recall correctly, this (with a lightning texture during transitions) was used by Command & Conquer: Renegade.
Another option is blurring. Again, render to texture. No shaders needed for this though.
Another is to render the previous frame where the object is. (Again, render to texture, no shaders)

Of course, there's no current device to grant full visible-spectrum invisibility, so just make something up. If it doesn't look bad, it'll be fine (You're only going to see if briefly, after all).


alright, thanks for your help everyone :)

And by the way how would you make that Distortion in 3d, I believe Starcarft (original) did this to give a Cloaked effect, of course it was using sprites, but could a distortion object be created that distorted a certain area according the cameras view and in the shape/radius/siloutte of an object?

Edited by kaibil, 09 June 2012 - 02:46 AM.

  • 0

#13 TheSnidr

TheSnidr

    That guy

  • Global Moderators
  • 2472 posts
  • Version:GM:Studio

Posted 09 June 2012 - 08:06 AM

[...]but could a distortion object be created that distorted a certain area according the cameras view and in the shape/radius/siloutte of an object?

Did you see my link?
  • 0

#14 kaibil

kaibil

    GMC Member

  • GMC Member
  • 119 posts
  • Version:GM8

Posted 09 June 2012 - 01:41 PM


[...]but could a distortion object be created that distorted a certain area according the cameras view and in the shape/radius/siloutte of an object?

Did you see my link?


yeah, but i tried all three of your examples (that were in your link)
and there were no objects, all that could be seen was the sky background...
  • 0

#15 Gamer3D

Gamer3D

    Human* me = this;

  • GMC Member
  • 1620 posts
  • Version:GM:Studio

Posted 09 June 2012 - 08:34 PM

yeah, but i tried all three of your examples (that were in your link)
and there were no objects, all that could be seen was the sky background...

You asked for invisibility. Why are you complaining when you can't see it? :biggrin:
  • 0

#16 kaibil

kaibil

    GMC Member

  • GMC Member
  • 119 posts
  • Version:GM8

Posted 09 June 2012 - 09:36 PM


yeah, but i tried all three of your examples (that were in your link)
and there were no objects, all that could be seen was the sky background...

You asked for invisibility. Why are you complaining when you can't see it? :biggrin:


ha youre funny, I should have been more clear... The objects werent being drawn, what is shown in the screenshots theSnidr put up, isnt show on mine :/

Edited by kaibil, 09 June 2012 - 09:36 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users