Professional Web Applications Themes

Aaaarrrggh! Texture/shader nightmare! - Macromedia Director 3D

I'm trying to apply a texture to one of the models in my scene so that the model (a white rectangle) displays my texture (a logo). Now when I do this it only appears to display the very bottom left corner of my texture member and blurred as though it's extremely close. I know that the texture has been applied etc. because if I apply a reflectionmap then I can clearly see the log as I move around with cameras in the room. Here's my code (I've ommited variable declaration etc. for clarity): -- create the texture here on createtexture ...

  1. #1

    Default Aaaarrrggh! Texture/shader nightmare!

    I'm trying to apply a texture to one of the models in my scene so that the
    model (a white rectangle) displays my texture (a logo).
    Now when I do this it only appears to display the very bottom left corner of
    my texture member and blurred as though it's extremely close.
    I know that the texture has been applied etc. because if I apply a
    reflectionmap then I can clearly see the log as I move around with cameras in
    the room.


    Here's my code (I've ommited variable declaration etc. for clarity):


    -- create the texture here
    on createtexture
    screentexture = scene.newtexture("logo", #fromcastmember, member("logo"))
    end


    -- now create shader
    ----------------------------
    on createshaders
    screenshader = scene.newshader("logo", #standard)

    -- i've experimented with these values, makes v little difference
    screenshader.diffuse = rgb(250,250,250)
    screenshader.ambient = rgb(250, 250, 250)
    screenshader.diffuse = rgb(250, 250, 250)
    screenshader.emissive = rgb(250, 250, 250)

    scene.shader("screen").texture = screentexture
    screenshader.texture = screentexture

    --------------------------------------------------------------------------------
    ----------------------------
    -- i've changed these values in the hope that tiling would make the logo
    appear

    --------------------------------------------------------------------------------
    ----------------------------
    screenshader.texturetransform.scale(1,1,1)
    screenshader.reflectionmap = screentexture
    end


    I'm banging my head against a virtual wall with this one.. any ideas??

    cheers
    Rich



    mufc 1974 Guest

  2. #2

    Default Re: Aaaarrrggh! Texture/shader nightmare!

    as an update to this I've discoverd that only the bottom left pixel of the logo
    is being mapped onto my model!
    I discovered this by placing colours in set areas, red in the bottom left and
    only the red pixel is displayed. What the hell is going on?? Very confused..
    ps. I tested it on another model & got the same results - I've also tested
    with many different image members & it's the same.

    mufc 1974 Guest

  3. #3

    Default Re: Aaaarrrggh! Texture/shader nightmare!



    global w,init

    on beginSprite me
    w = member("W3D_name")
    w.newTexture("logo",#fromCastMember,member("logo") )
    -- optional --
    w.newModelResource("myModel",#plane)
    w.modelResource("myModel").width = 100
    w.modelResource("myModel").length = 100
    w.newModel("myModel", w.modelResource("myModel"))
    --------------
    init = 0
    end

    on exitFrame me
    if init = 0 then
    w.model("myModel").shader.texture = w.texture("logo")
    init = 1
    end if
    end

    necromanthus Guest

  4. #4

    Default Re: Aaaarrrggh! Texture/shader nightmare!

    i think its not possible that you enabled "Trim White Space" when you import the texture? that would be too easy :)

    can you upload the texture or the file? i am interested in seeing this problem.
    hondo3000 Guest

  5. #5

    Default Re: Aaaarrrggh! Texture/shader nightmare!

    Originally posted by: mufc 1974
    that's pretty much what I've already got, that code does exactly the same
    thing ie. only displays what appears to be the bottom left pixel of my logo
    across the model.

    The above script works just fine (for that LINGO generated plane, or any other
    imported object).
    So ... your real problem is a wrong UV mapping for that "rectangle".



    necromanthus Guest

  6. #6

    Default Re: Aaaarrrggh! Texture/shader nightmare!

    Originally posted by: necromanthus
    Originally posted by: mufc 1974
    that's pretty much what I've already got, that code does exactly the same
    thing ie. only displays what appears to be the bottom left pixel of my logo
    across the model.

    The above script works just fine (for that LINGO generated plane, or any other
    imported object).
    So ... your real problem is a wrong UV mapping for that "rectangle".




    OK thanks I've tried various images & always the same result.. (btw I agree
    this code works fine for a standard code-generated plane or surface). So does
    this mean that the model needs to be exported differently to alter it's UV
    mapping (which incidently I know zero about!).
    Basically the model is a room which contains a projector screen that I want to
    map a log onto & light. Thought it would be a synch but it only shows the
    bottom left pixel blurred across the entire model surface!
    B******s!



    mufc 1974 Guest

Similar Threads

  1. Shader vs Texture : Performance?
    By LovehinaC in forum Macromedia Director 3D
    Replies: 1
    Last Post: January 28th, 07:29 PM
  2. Shader Issue
    By Lisa Phillips in forum Macromedia Director 3D
    Replies: 2
    Last Post: August 11th, 02:33 AM
  3. beginner shader/texture question
    By Will Hogben in forum Macromedia Director 3D
    Replies: 1
    Last Post: June 17th, 02:36 PM
  4. 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
  5. just trying to make my shader's texture not squish to fit the plane..
    By kemical webforumsuser@macromedia.com in forum Macromedia Director 3D
    Replies: 4
    Last Post: December 2nd, 05:27 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