Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: jgalvezpa on April 05, 2014, 11:45:25 PM

Title: How to do this with playmaker
Post by: jgalvezpa on April 05, 2014, 11:45:25 PM
Hello wondering if playmaker or unity can do this and how

thanks

http://www.syntaxwarriors.com/2012/xna-alpha-mapping-with-pixel-shader-and-rendertarget2d/
Title: Re: How to do this with playmaker
Post by: jgalvezpa on April 07, 2014, 08:45:33 PM
bump!
Title: Re: How to do this with playmaker
Post by: jeanfabre on April 08, 2014, 03:52:20 AM
Hi,

 is the example provided works? If that's the case, simply change that RemovePlanetChunk function to be public and you can then access it using the invoke action.

bye,

 Jean
Title: Re: How to do this with playmaker
Post by: jgalvezpa on April 08, 2014, 09:15:10 AM
i want to use it differently, with an explosion i don't know much about scripting
can i create that script with states machines? and how?

rendertarget2d doesn't exist in unity i think.

Title: Re: How to do this with playmaker
Post by: jeanfabre on April 09, 2014, 04:36:08 AM
Hi,

Basically, it's quite advanced, and involving to port this to a 100% PlayMaker solution. This would require some large ground work to provide access to this in a practical way. Hence, I agree with Alex, looking for a proper SDK provided by a third party asset make sense and then we could plug Playmaker with few custom actions to control that SDK.

My advice would be to simply edit that function to make it public and then call it from playmaker with your vector 2 point of choice.

Have you experimented with this already? In a case of explosion, what is the interaction you expect? that gameobjects as they fly mask the texture as they fly over it?


Bye,

 Jean
Title: Re: How to do this with playmaker
Post by: jgalvezpa on April 09, 2014, 09:42:22 PM
hey could you do the script really quick and send it to me , i don't know nothing about scripting.
about the explosion for example i want when the bomb explode, the sprite looks like has been broken just like the video
Title: Re: How to do this with playmaker
Post by: jgalvezpa on April 11, 2014, 09:08:35 PM
bump
Title: Re: How to do this with playmaker
Post by: jeanfabre on April 14, 2014, 04:54:29 AM
Hi,

 for this, you really need to use a sprite slider like:

https://hutonggames.fogbugz.com/default.asp?W1177

 else, can you draw a example of the final result? cause in this video, there is no "explosion", just manual hand drawing.


bye,

 Jean
Title: Re: How to do this with playmaker (SOLVED)
Post by: jgalvezpa on April 14, 2014, 05:35:21 AM

I want the explosion to be the same like in video, i search for plugins like slicer and fracture etc but they dont work like in the video.
Somebody told me to this

In unity the easiest way would be to have an image (with alpha channel) and use the methods in Texture2d like getpixel/setpixel to modify the alpha channel to create holes/missing areas. Using those same functions you can check for collision when shooting at it. Though that may be slow, building the same functionality into a shader might get better results as you can leverage the gpu instead of the cpu. I would start with the Texture2D methods and see how it works out. Then move to a shader based solution if you need to.

How can i do that with playmaker?
Title: Re: How to do this with playmaker
Post by: jgalvezpa on April 15, 2014, 12:01:57 AM
i figure out that is all about shaders and alpha channels.ore specifically a shader method called 'Alpha mapping'.
Alpha mapping is done by using the original texture and another greyscale texture that defines what parts are visible or not.

The idea of the shader is to go through each pixel in the original texture and check how black each pixel in the greyscale image is at the same coordinate. The blacker the pixel in the greyscale picture is the higher the alpha value (more visible) the pixel in the original texture becomes. Since all this is done on the GPU it is lightning fast and leaves the CPU ready to do the actual logic for the game

do you have any experience doing that? i will try to learn
Title: Re: How to do this with playmaker
Post by: jgalvezpa on April 15, 2014, 09:32:41 PM
bump
Title: Re: How to do this with playmaker
Post by: jeanfabre on April 17, 2014, 11:27:44 AM
Hi,

 Give me few more days, I will work something out using the project sample you mentionned.

bye,

 Jean
Title: Re: How to do this with playmaker
Post by: jgalvezpa on April 17, 2014, 03:52:53 PM
thanks really appreciated, i will try also to do it
Title: Re: How to do this with playmaker
Post by: jeanfabre on April 28, 2014, 11:59:49 AM
Hi,

 ok, Here we go. Lucky you, it's the first custom samples that will be features on the ecosystem I am working on:

MaskTextureDrawing Sample (https://github.com/jeanfabre/PlayMakerCustomActions_U3/raw/master/PlayMaker/Ecosystem/Custom%20Samples/Texture/MaskTextureDrawing.unitypackage)

With this, you will be able to cut out a texture using the alpha channel of anothe texture, all of this being non desctructive. It's basically a masking system.

Tell me if you have questions.

Bye,

 Jean

 
Title: Re: How to do this with playmaker
Post by: jgalvezpa on May 02, 2014, 10:36:09 PM
Hi thanks for making this, i want to know i how to delete the texture when collide with something, like a bomb
Title: Re: How to do this with playmaker
Post by: jgalvezpa on May 05, 2014, 11:04:26 PM
or only works with raycast? cannot be done by colliding with objects?
Title: Re: How to do this with playmaker
Post by: jgalvezpa on May 06, 2014, 09:41:01 PM
bump
Title: Re: How to do this with playmaker
Post by: jeanfabre on May 07, 2014, 05:59:00 AM
Hi,

 When colliding, get the collision info and the hit point, that's your position to work with.

bye,

 Jean
Title: Re: How to do this with playmaker
Post by: jgalvezpa on May 07, 2014, 10:25:02 PM
hey i cannot get to work right with collision , when the collision happen, i use Getcollisioninfo to get the Conctact Point and store it in a Vector3 variable then use Vector3 Operator( in the example you use Vector2 Operator) then go to Draw State and i have to change the variable of the Texture Draw Circle to a vector3.
 but doesnt work.

By the way im using a 2D mode camera with orthographic.