#111 texture(name) not varying

open-accepted
nobody
None
5
2009-06-24
2009-06-24
No

It appears that the texture name parameter of the texture() function is uniform. I have a situation where I'm loading multiple textures in a loop and require "name" to be varying...

for (i = 0; i < GLOB_TEX_CHANNELS; i += 1)

{

Name = GlobUS_X0[i];

if (Name != "")

{

Cp1 = color(float texture(Name[0], sAdj, tAdj, "blur", p1));

where GlobUS_X0[i] is a list passed as a shader parameter. This seems to work fine in 3Delight, Air, PrMan and Aqsis.
Attached is 3Delight/Pixie comparison renders showing Pixie only using the first texture multiple times.

Discussion

  • Anonymous - 2009-06-24
     
  • Anonymous - 2009-06-24
     
  • Anonymous - 2009-06-24

    Cédric PAILLE has emailed concerning this bug however my email reply's are being rejected :-/ I'll post the reply and the example rib in hopes he will see it here!

    reply:
    Not trying to be difficult but I'm not following you. MOSAIC does not have a file called ShaderFunctions.h but does have a file MOSAICFunctions.h however that one does not go over 1153 lines. Then I thought maybe you were referring to shader code in mosaic.py but on line 1474 I have " float isCubic; // Use cubic terminator blend" :-/
    Also I do not have "if ((tex = lookup->map) == NULL)" in any of MOSAIC's shaders. Are you sure your using the HEAD version 1.54 from here http://ribmosaic.cvs.sourceforge.net/viewvc/ribmosaic/mosaic/mosaic.py?view=log ??

    I've attached a rib example that highlights the problem. This example will multiply grid1.tx on top of grid2.tx using texture names from the shader parameter. The printf shows the names are reaching texture() but it is only using the first texture twice. This example works fine for 3Delight, Air and Aqsis. Also included is a test render from Aqsis to show what it should look like

     
  • Anonymous - 2009-06-24
     
  • Cedric PAILLE

    Cedric PAILLE - 2009-06-24

    Hi,

    It's in Pixie's shaderFunction.h in the ri directory !

    Here's the patch !

    Should fix SSS too.

    Cheers.

     
  • Okan Arikan

    Okan Arikan - 2009-06-24
    • status: open --> open-accepted
     
  • Okan Arikan

    Okan Arikan - 2009-06-24

    Yes, this is a Pixie limitation due to an optimization so that we do not check the texture name for every shading point individually.

    It is actually possible to do this without any speed penalty, but I need to think about a lean implementation without too much code replication.

    Okan

     
  • Cedric PAILLE

    Cedric PAILLE - 2011-06-20

    Hi,
    You must modify the shaderFunction.h file in the pixie's source code not the mosaic one.

    Hope it will help

     

Log in to post a comment.