Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GLSL texture lookups in shader builder



OK. So it basically was some user error and a GLSL misunderstanding on my part. I'm still not able to grab anything from the second texture unit, though. I have a texture defined for texture units 0 and 1. Both have "enabled" checked and are clamped to edge.

To the best of my knowledge the program below should pass through the second unit texture, but It's always using the first texture.

uniform sampler2D texture0;
uniform sampler2D texture1;

void main()
{
    vec4 pixel0 = texture2D(texture0, gl_TexCoord[0].st);
    vec4 pixel1= texture2D(texture1, gl_TexCoord[0].st);
    gl_FragColor = pixel1;
}

Am I doing this correctly, or is this a bug in Shader Builder?

-------------------
Tobias Ford...
tobias1482 'at' mac.com
tford 'at' soe.sony.com
-------------------
Programmer @ SOE Austin for Star Wars Galaxies

On May 29, 2005, at 11:16 AM, Geoff Stahl wrote:

Create a sampler type uniform. Use shader builders normal methods to set this value to the desired value. Shader Builder does not currently support multiple passes with code defined uniforms (or similar schemes). I be missing what you are trying to do but the above is the general way to get texture unit ids into a shader.

Geoff Stahl
3D Software Engineer
Apple

On May 29, 2005, at 5:10 AM, tobias ford wrote:


I'm just now starting to play around with Shader Builder and GLSL and I'm trying to just write a pass-through shader with multiple textures to start.

What is it that I need to do in regards to getting a texture sampler. Since these are named from code, I was wondering if SB had some default name specified that I could use in the lookup.

I also don't recall seeing any generic way to access this by texture unit in the orange book.

Thanks.

-------------------
Tobias Ford...
tobias1482 'at' mac.com
tford 'at' soe.sony.com
-------------------
Programmer @ SOE Austin for Star Wars Galaxies

She's so swishy in her satin and tat
In her frock coat and bipperty-bopperty hat
Oh God, I could do better than that

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden

This email sent to email@hidden





_______________________________________________ Do not post admin requests to the list. They will be ignored. Mac-opengl mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/mac-opengl/email@hidden

This email sent to email@hidden
References: 
 >Re: Motion Blur at 30 fps (From: Lorenzo Puleo <email@hidden>)
 >GLSL texture lookups in shader builder (From: tobias ford <email@hidden>)
 >Re: GLSL texture lookups in shader builder (From: Geoff Stahl <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.