Results 1 to 3 of 3

Thread: Texture combiners

  1. #1

    Texture combiners

    Supposing to have two textures bound on, respectively, texture unit 0 and texture unit 1.
    Modulating them (t0 * t1), is there a way to obtain:

    t0.r * t1.r
    t0.g * t1.r
    t0.b * t1.r
    t0.a * t1.r

    What I need is to consider all the t1 channels equal to t1 red channel.
    Is there an operand that realizes this?

    Thanks in advance.
    AmanithVG Lead Programmer

  2. #2
    Junior Member
    Join Date
    Dec 2008
    Location
    Oslo, Norway
    Posts
    25

    Re: Texture combiners

    Not directly, but if you have at least 3 texture stages available, I guess you could feed in <1,0,0> in as the constant color and dot t1 with that.
    Erik "kusma" Faye-Lund

  3. #3
    Senior Member
    Join Date
    May 2006
    Posts
    353

    Re: Texture combiners

    It's unfortunate that there is no unsigned dot product, so you would indeed need three stages:
    First you would need a lerp to remap t1 to [0.5, 1], perform a dot3 with <1, 0.5, 0.5>, then modulate with t0.

    However you might run into precision issues with this since you lose a bit in the remap step, and 0.5 might not have an accurate representation in the numerical format used in the fragment pipeline. And the biggest issue of course, you can't expect ES 1.x implementations to have three texenv stages.

    I am of course assuming that t1 is a rendertarget texture, otherwise the problem should be easily solvable at the texture upload stage.
    Georg Kolling, Imagination Technologies
    Please ask questions specific to PowerVR hardware or SDKs on the PowerVR Insider Forum
    DevTech@imgtec.com | http://www.powervrinsider.com

Similar Threads

  1. Texture Objects and texture management
    By alh in forum OpenGL ES general technical discussions
    Replies: 4
    Last Post: 02-13-2005, 02:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •