Jump to content


Shader Question - Alpha Blending or Color from Background?


  • You cannot reply to this topic
No replies to this topic

#1 hand

    New Member

  • Members
  • Pip
  • 1 posts

Posted 20 June 2009 - 01:43 PM

Hi,

I have a shader question and I hope that somebody has an answer to it.

My scene consists of an plane background object with a texture and a moving object with a texture (plane/or 3D).

Posted Image

What I want to achieve is that the moving object gets coloured like the background
texture at the given position of the moving object.

Posted Image
Posted Image

I want to do this with a shader, because if it comes the colour pixels,
it's the right place to go. My prefered shader language is CG but if you familial with any other I'll be able to adapt it.

What I do know is the position of the moving object the position and
the dimension of the background texture.

Maybe I'm trying to do something very simple because I can't find
anything in the web, or I'm using the wrong buzz words.

This is actually a workaround for my original problem that I have:

I'm using a particle system where the particle is a plane object and has a translucent circle
with a white border as texture, so you can see the background through it.
And the more particle there are the brighter the white will get.

Posted Image

That behavior is right but not realy wanted. Because when the number
of the particle went through the roof, I end up with an opaque white
and the particles form a spongy mass and you can't see any more details in it.

Posted Image

Is there an apha blending mode that I missed that will do the job?
I'm using "add color" right now ...

One way to solve this problem is to make the center of particle texture opaque,
but I'm using the background texture as static light source so the particle gets
brighter at the top of the scene and darker at the bottom.

Thank you for your help.
If you need more details please ask.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users