playMaker

Author Topic: RGBA Colour Picker Action - Extending Raycast & Screen Pick, Painting  (Read 7143 times)

Drakon

  • Playmaker Newbie
  • *
  • Posts: 21
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
« Last Edit: July 25, 2011, 05:55:59 AM by Drakon »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: RGBA Colour Picker Action - Extending Raycast & Screen Pick
« Reply #1 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

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

Else, it would be a lot more involving.

Bye,

 Jean

Drakon

  • Playmaker Newbie
  • *
  • Posts: 21
Re: RGBA Colour Picker Action - Extending Raycast & Screen Pick
« Reply #2 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.
« Last Edit: July 25, 2011, 08:25:47 AM by Drakon »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
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

Drakon

  • Playmaker Newbie
  • *
  • Posts: 21
Great thank you kindly!
Drakon

Drakon

  • Playmaker Newbie
  • *
  • Posts: 21
Re: RGBA Colour Picker Action - Extending Raycast & Screen Pick, Painting
« Reply #5 on: February 06, 2012, 02:17:07 PM »
Hiya,

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

Thank you