Playmaker Forum

PlayMaker Feedback => Action Requests => Topic started by: Drakon on July 21, 2011, 05:47:13 AM

Title: RGBA Colour Picker Action - Extending Raycast & Screen Pick, Painting
Post by: Drakon on July 21, 2011, 05:47:13 AM
Could some kind person please extend the functionality of one of these actions so that RGBA value under the ray/mouse/touch hit can be sampled and stored. Something like:

= Store RGBA or
= Store Point RGBA or
= Get Color RGBA

in
Get Ray Cast Hit info
Screen Pick
Ray Cast

This could prove to be very useful for painting type apps and cool targeting systems. Thank you so much. Drakon
Title: Re: RGBA Colour Picker Action - Extending Raycast & Screen Pick
Post by: jeanfabre on July 25, 2011, 03:03:21 AM
Hi,

 If you are ok with the constraint that the model needs to have a mesh collider attached, I can implement the following code:

http://unity3d.com/support/documentation/ScriptReference/RaycastHit-textureCoord.html (http://unity3d.com/support/documentation/ScriptReference/RaycastHit-textureCoord.html)

 and use getpixel on the texture coordinate returned by the raycast.

Else, it would be a lot more involving.

Bye,

 Jean
Title: Re: RGBA Colour Picker Action - Extending Raycast & Screen Pick
Post by: Drakon on July 25, 2011, 05:31:19 AM
Absolutely, Thank you! - totally Ok with mesh collider.
This will be incredibly useful  - I could achieve a great deal with this approach !!!

I was also wandering if the Toon Outline shader is using vertex colours for the outline. Ideally I'm seeking a way to pick out the specific colour of the outline with raycast info, and then use the position and colour to create targets for particles.  Essentially I'm using the outline as Edge Detect in photoshop - once 'extracted' out into [xyz] it opens the door to a host of coolest FX.  If getting the vertex colour isn't possible then the uv texture colour will be fine. If the normals are inverted I can simulate toon outline and then continue from there with your suggested approach.

It's also in line with the current requirement of Mouse Pick for mesh collider I believe.
I assume that with larger scenes the absence of collider will speed things up considerably - this would be great addition in the long term.
 ;D

Thank you very much!!!
Drakon.
Title: Re: RGBA Colour Picker Action - Extending Raycast & Screen Pick, Painting
Post by: jeanfabre on July 26, 2011, 06:05:42 AM
Hi,


 I am unsure about the way to get to the toon oultine color. Ask on UnityAnswers, you should get some good response.

 Allow me few days, and I'll look into these custom action.

 Bye,

 Jean
Title: Re: RGBA Colour Picker Action - Extending Raycast & Screen Pick, Painting
Post by: Drakon on July 26, 2011, 07:58:30 AM
Great thank you kindly!
Drakon
Title: Re: RGBA Colour Picker Action - Extending Raycast & Screen Pick, Painting
Post by: Drakon on February 06, 2012, 02:17:07 PM
Hiya,

Just wandering if there is any news on the colour picker front?

Thank you