Professional Web Applications Themes

Multiple texture layers - Macromedia Director 3D

I've been using Director for years, but am new to 3D. I have a plane, that the user dynamically swaps textures on using: -- member("Scene2").deleteTexture("planeTexture") -- member("Scene2").newTexture("planeTexture", #fromCastmember, member("3D_texture")) -- member("Scene2").shader("planeShader").texture = MEMBER("SCENE2").texture("planeTexture") (I load the chosen texture from a file into cast member "3D_texture") The above shows the users "driveway" I am now trying to add another texture layer, which will be a bitmap of a patterned circle: a square png with a circular alpha channel) so the user can move it around to see where on their driveway they'd like it see photoshop mockup: "http://trgs.net/client/pic_for_help.jpg" the outcome will ...

  1. #1

    Default Multiple texture layers

    I've been using Director for years, but am new to 3D.

    I have a plane, that the user dynamically swaps textures on using:
    -- member("Scene2").deleteTexture("planeTexture")
    -- member("Scene2").newTexture("planeTexture", #fromCastmember,
    member("3D_texture"))
    -- member("Scene2").shader("planeShader").texture =
    MEMBER("SCENE2").texture("planeTexture")
    (I load the chosen texture from a file into cast member "3D_texture")

    The above shows the users "driveway" I am now trying to add another texture
    layer, which will be a bitmap of a patterned circle: a square png with a
    circular alpha channel) so the user can move it around to see where on their
    driveway they'd like it

    see photoshop mockup:

    "http://trgs.net/client/pic_for_help.jpg"

    the outcome will show my base texture (from the lines of code above) and a
    circle on top of that texture that the user can move, so the perspective will
    automatically adjust as they move it around the plane.

    But I can't get the second texture to work, I've tried things like:

    -- member("Scene2").newTexture("Circle2texture",#from Castmember,
    member("circle2"))
    -- member("Scene2").model("plane").addModifier(#meshD eform)
    --
    member("Scene2").model("plane").meshdeform.mesh[2].texturelayer.add("Circle2text
    ure")

    but the whole object just goes pink!

    am i trying to do something that can't be done?

    all help greatfully recieved (the client wants it on tuesday!)

    Cheers
    Jez.

    Jez C Guest

  2. #2

    Default Re: Multiple texture layers

    The easiest thing might be to just create another plane with another texture on
    top. Otherwise, just use the shader's texturelist[ ] property to do the work
    and disregard #meshDeform.

    Set the texturelist[1] of your shader to the driveway bricks, then shader's
    texturelist[2] to your texture with the alpha. Then set shader's
    blendFunctionList[2] to #blend, and blendsourceList[2] to #alpha.

    Your alpha texture will then be a "decal" on top of the bricks texture. You
    can then move the decal texture around using textureTransfromList[2].position.
    But make sure your alpha has enough "whitespace" on the edges, else you'll get
    streaking.

    ** Important to note that the renderer will affect how this looks. I think the
    above description is good with directX but if using openGL you may need to use
    blendsourceList[2] = #constant and blendConstantList[2] = 100.

    tedalde2 Guest

  3. #3

    Default Re: Multiple texture layers

    tedalde2 you're a star

    it works like a dream, (except for the transformList[2].position command, which makes the circle disappear - see my post this morning)

    any ideas?
    Jez C 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. blend texture layers relative to camera distance
    By Grampa Gar in forum Macromedia Director 3D
    Replies: 0
    Last Post: June 15th, 04:48 AM
  3. Help regarding multiple texture layers
    By jrPace in forum Macromedia Director 3D
    Replies: 5
    Last Post: July 6th, 10:02 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