Professional Web Applications Themes

Help regarding multiple texture layers - Macromedia Director 3D

Hi all. I'm was busy implementing a lightmapping solution for use within director when I came up against this problem [url]http://www.provincemedia.com/members/jpace/undead/problem.jpg[/url] On the right is how it should (roughtly) look. However, because I utilise more than one texture layer (one for the diffuse map, one for the lightmap) it seems to confuse director into drawing the scene in the incorrect order. As you can see, the floor seems to be getting drawn last and overlapping things in the foreground. I'm stuck for what to do. Anyone else had this problem? Regards Jonathan Pace [url]http://www.unwrong.com[/url]...

  1. #1

    Default Help regarding multiple texture layers

    Hi all.

    I'm was busy implementing a lightmapping solution for use within director when
    I came up against this problem

    [url]http://www.provincemedia.com/members/jpace/undead/problem.jpg[/url]

    On the right is how it should (roughtly) look. However, because I utilise more
    than one texture layer (one for the diffuse map, one for the lightmap) it seems
    to confuse director into drawing the scene in the incorrect order. As you can
    see, the floor seems to be getting drawn last and overlapping things in the
    foreground.

    I'm stuck for what to do. Anyone else had this problem?

    Regards
    Jonathan Pace
    [url]http://www.unwrong.com[/url]

    jrPace Guest

  2. #2

    Default Re: Help regarding multiple texture layers

    The sorting problem you're seeing is probably because of the catwalk's
    transparency (and not necessarily because of the secondary texture). Try
    setting the shader's transparency to zero (to override the grate texture's
    alpha) and see if it gets drawn correctly. It's my understanding that the SW3D
    renderer draws all non-transparent meshes first, writing to the z-buffer in the
    process, then draws all transparent meshes, using the center point of the mesh
    to determine occlusion and draw order. This generally works, but will result
    in sorting errors if the center point is no longer 'representative' of the
    z-depth of the mesh (or portion of the mesh, as in your case). The easiest
    solution would be to split the catwalk model in shorter horizontal pieces. You
    can also try adding a dummy triangle to the floor far enough away (down) to
    ensure it always gets drawn first.

    nick kang Guest

  3. #3

    Default Re: Help regarding multiple texture layers

    There was an article on Z-Buffer cheating on [url]www.shockwavemovies.com[/url]
    but it seems to be down.

    Any ideas what happend with this Tom Higgins' page ?

    Ziggi
    Ziggi Guest

  4. #4

    Default Re: Help regarding multiple texture layers

    Thanks for the help. It gave me something to go on.

    As it turns out, all shaders exported from max have their 'transparent' flag
    set to TRUE by default (even if it hasn't got an opacity map). Which means 3D
    engine is having to treat the models with these textures as alpha blended,
    which causes all kinds of sorting problems (and is also slower).

    So I placed a simple handler that looped through all the shaders in my scene
    on load and reset this value to FALSE, and this fixed it.

    Hope this comes in handy for others out there.

    Regards
    Jonathan Pace
    unwrong.com

    jrPace Guest

  5. #5

    Default Re: Help regarding multiple texture layers

    No prob, glad to see this was the problem and not something else. Just want to
    add that the transparent flag actually doesn't make a model "transparent" as
    far as the z-sorting is concerned, rather it "enables" transparency when the
    blend is less than 100 or there is alpha data in the texture. But setting it
    to zero always overrides either condition. So having the Max exporter set it
    to 1 by default generally shouldn't be a problem.

    nick kang Guest

  6. #6

    Default Re: Help regarding multiple texture layers

    That's what I thought, however it was this, and only this setting I changed to
    fix the problem. So maybe the flag does effect the sorting method used if the
    mesh has more than one texturelayer? Perhaps its just a graphics card thing.
    Either way, worthwile keeping an eye on.

    Once again, thanks for your help

    jrPace Guest

Similar Threads

  1. Multiple texture coordinates??
    By Phoonzang webforumsuser@macromedia.com in forum Macromedia Director 3D
    Replies: 1
    Last Post: April 21st, 04:16 AM
  2. Multiple texture layers
    By Jez C in forum Macromedia Director 3D
    Replies: 2
    Last Post: August 14th, 12:25 PM
  3. blend texture layers relative to camera distance
    By Grampa Gar in forum Macromedia Director 3D
    Replies: 0
    Last Post: June 15th, 04:48 AM
  4. Blending texture layers
    By Will Hogben in forum Macromedia Director 3D
    Replies: 2
    Last Post: June 18th, 03:46 PM
  5. Assigning UV coordinates to a texture in shader layers
    By Petter MS in forum Macromedia Director 3D
    Replies: 0
    Last Post: December 29th, 12:22 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139