Home Tutorials Download Beta Store Forum Documentation KnowledgeBase Wiki Blog

ShiVa3D

Return to Creation

Real time Alpha channel manipulation

Shaders, Level design, Sound design, Special effects

Real time Alpha channel manipulation

Postby almighty » 22 May 2012, 16:35

Hi guys I don't know if this effect can be reached with Shiva, anyway below a short description of what I'm trying to achieve:

I have 2 layers with two different images of the same landscape, I would like to delete the image on the second layer using the touch in order to show the image of the first layer. Both images overlap with a very little offset. I thought that I could obtain this manipulating the alpha channel of the second layer's image, but I don't if I can do this using Shiva.

This is a shot showing the concept
Image
almighty
Gold Boarder
Gold Boarder
 
Posts: 186
Location: ROMA

Re: Real time Alpha channel manipulation

Postby Fraser » 22 May 2012, 21:13

I'm not sure if it can be done with alpha, maybe it can?

But one way that it might possibly be done is to apply textures onto seperate grid meshes, place the meshes close together then raise or lower the grid in chosen areas using mesh API.
Fraser Ashworth,
https://www.cortex7.net
User avatar
Fraser
Platinum Boarder
Platinum Boarder
 
Posts: 1086
Location: Europe

Re: Real time Alpha channel manipulation

Postby makkar » 22 May 2012, 21:40

@almighty: I'll tell you how if you tell me a secret about Voyager Xdrive Roman Forum :wink:

You can do what you want using a pixelmap:
- create a pixelmap for your top layer texture and fill it with your texture
- have the bottom layer as a regular HUD element
- place the pixelmap in another HUD element with higher z value
- change the pixelmap's alpha value according to the touch input, that will punch the top layer.

My question waits for you here:
http://www.stonetrip.com/developer/forum/viewtopic.php?f=26&t=17731&p=46366#p46366
User avatar
makkar
Platinum Boarder
Platinum Boarder
 
Posts: 1519

Re: Real time Alpha channel manipulation

Postby almighty » 23 May 2012, 09:17

Hi again Makkar, I've read fisrt your post into the Voyager thread. Thanks for your support as I wrote in the other thread let me only the time to collect the code for you.
almighty
Gold Boarder
Gold Boarder
 
Posts: 186
Location: ROMA

Re: Real time Alpha channel manipulation

Postby Benton » 04 Jun 2012, 20:01

You want some parts of the image black and white, and one part coloured?

Make separate meshes for each part, with a black and white material, and a coloured one.
Join us and chat about ShiVa: http://mibbit.com/#shiva@irc.shivaplace.com:6669\
Or connect your IRC client to: irc.shivaplace.com:6669
User avatar
Benton
Expert Boarder
Expert Boarder
 
Posts: 146

Re: Real time Alpha channel manipulation

Postby almighty » 05 Jun 2012, 13:38

Hi benton,
no I want to delete the pixels of the top (coloured) image with the finger, revealing the bottom image. I used a black&white image just to make an example of what I'm looking for.
almighty
Gold Boarder
Gold Boarder
 
Posts: 186
Location: ROMA

Re: Real time Alpha channel manipulation

Postby Benton » 08 Jun 2012, 16:24

Oh I see. You could have many variations of the top image but I am guessing you want the alpha to be dynamic. All I can really suggest is to write your own plugin.
Join us and chat about ShiVa: http://mibbit.com/#shiva@irc.shivaplace.com:6669\
Or connect your IRC client to: irc.shivaplace.com:6669
User avatar
Benton
Expert Boarder
Expert Boarder
 
Posts: 146

Re: Real time Alpha channel manipulation

Postby makkar » 08 Jun 2012, 17:14

@ almighty:
Did you try the pixelmap solution I suggested? It should be quite easy. Or did you have any problems with it?

There is a sample application when you install Shiva: 3DPaint. It has all kinds of pixelmap manipilation.
User avatar
makkar
Platinum Boarder
Platinum Boarder
 
Posts: 1519

Re: Real time Alpha channel manipulation

Postby almighty » 19 Jun 2012, 15:12

hi Makkar,
sorry for the long time reply......yes I played around with the 3d spray demo, but I haven't seen the code yet. Anyway if I'll need some help I'll be in touch with you.

Cheers and thanks for the interest.
almighty
Gold Boarder
Gold Boarder
 
Posts: 186
Location: ROMA


Return to Creation