Results 1 to 2 of 2

Thread: texture2D function on Android 3.2

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    1

    texture2D function on Android 3.2

    Hi,

    i'm pretty new to OpenGL ES 2.0 and I try to produce a fragment shader that gives me a texture and a simple diffuse lighting. It works fine with the texture only:
    Code :
    gl_FragColor = texture2D(uTex, vTexCoord);
    If i use my calculated diffuse value on a constant vector, the result is as expected, too:
    Code :
    gl_FragColor =  diffuse * vec4(0.0, 0.0, 1.0, 1.0);

    Here is the problem: If I multiply the texture lookup result by the diffuse float, there is no render result at all on the screen:
    Code :
    gl_FragColor = diffuse * texture2D(uTex, vTexCoord);
    The device is a Motorola XOOM with Android 3.2. Any help is highly appreciated.

    Regards,
    Daniel

  2. #2

    Re: texture2D function on Android 3.2

    What exactly do you have inside the "diffuse" variable? Have you initialized it?

    Also, can you show what do you have in "uTex, vTexCoord"? This information might help to point what could be the cause of your problem.

Similar Threads

  1. Is texture2D allowed in a *vertex* shader?
    By sharoz in forum Developers Coding:Beginner
    Replies: 4
    Last Post: 12-07-2010, 02:31 PM
  2. Sampling an alpha texture with texture2D
    By TomCooksey in forum OpenGL ES 2X - for programmable 3D graphics pipelines
    Replies: 4
    Last Post: 04-16-2009, 11:41 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
  •