Professional Web Applications Themes

Alphering the shader groups of a model to make it 50% transperant but not any of the others... - Macromedia Director 3D

Is it possible to Alpha the shader groups of a model to make it 50% transparent but not any of the others models in the world that use the same shared texture in their shadergroup. When I'm doing it I am grabbing all the shadergroups of that model and setting them to 50% but any other model using the same texture will Alpha also. Is their a way to prevent this? Chris...

  1. #1

    Default Alphering the shader groups of a model to make it 50% transperant but not any of the others...

    Is it possible to Alpha the shader groups of a model to make it 50%
    transparent but not any of the others models in the world that use the same
    shared texture in their shadergroup.

    When I'm doing it I am grabbing all the shadergroups of that model and
    setting them to 50% but any other model using the same texture will Alpha
    also.

    Is their a way to prevent this?

    Chris


    Raki Guest

  2. #2

    Default Re:Alphering the shader groups of a model to make it 50% transperant but not anyof the others...

    try using shader.blend

    as in the example

    [url]http://www.geocities.com/hairybobby2000/barcode.html[/url]



    HAIRYBOBBY - why didn't I choose a really cool name like the vulcanpimp

    [url]http://www.geocities.com/hairybobby2000[/url]

    Photograpghy section

    [url]http://www.geocities.com/hairybobby2000/px1.html[/url]

    Photoshop section

    [url]http://www.geocities.com/hairybobby2000/photo1.html[/url]
    hairybobby webforumsuser@macromedia.com Guest

  3. #3

    Default Re: Re:Alphering the shader groups of a model to make it 50% transperant but not anyof the others...

    yeah the code works but it shades everything

    code poorly copy and pasted below: But basically it shades every shader in the list otherwise if one of the txtures isn't blended then it won't alpher problem. But is there a way to restrict it to the model in question rather than a generall all models that use that shader?

    ================================================== ===
    if pBlend > pAlpha_min then

    repeat with x = 1 to pModel_alphad.shaderlist.count


    if pBlend + pBlend_modifier <= pAlpha_min then


    pModel_alphad.shaderlist[x].blend = pAlpha_min

    pBlend = pModel_alphad.shaderlist[x].blend


    else


    pModel_alphad.shaderlist[x].blend = pBlend - pBlend_modifier

    pBlend = pModel_alphad.shaderlist[x].blend


    end if


    end repeat


    end if


    if pBlend <= pAlpha_min then


    pAlpha_timeout.forget()


    repeat with x = 1 to pModel_alphad.shaderlist.count


    pModel_alphad.shaderlist[x].blend = pBlend


    end repeat


    end if



    ================================================== =======



    Chris



    "hairybobby" <webforumsusermacromedia.com> wrote in message news:bgqq01$5ai$1forums.macromedia.com...
    > try using shader.blend
    >
    > as in the example
    >
    > [url]http://www.geocities.com/hairybobby2000/barcode.html[/url]
    >
    >
    >
    > HAIRYBOBBY - why didn't I choose a really cool name like the vulcanpimp
    >
    > [url]http://www.geocities.com/hairybobby2000[/url]
    >
    > Photograpghy section
    >
    > [url]http://www.geocities.com/hairybobby2000/px1.html[/url]
    >
    > Photoshop section
    >
    > [url]http://www.geocities.com/hairybobby2000/photo1.html[/url]
    Raki Guest

  4. #4

    Default Re: Re:Alphering the shader groups of a model to make it 50% transperant but not anyof the others...

    It's not possible to set model transparency. It has to be done on shader
    level and it will affect all models using the same shader. The best solution
    is to replace all the shaders of all your models (or at least of those you
    intend to tweak uniquely) with duplicate shaders. I'm not sure if the
    duplicate() function works on shaders. You may have to write your own
    function for it. Roughly you'd do something like:

    -- skip first model, process all others
    repeat with i = 2 to pScene.model.count
    lModel = pScene.model[i]
    -- duplicate all shaders for this model
    repeat with j = 1 to lModel.shaderList.count
    lModel.shaderList[j] = MyFunctionToDuplicateShaders(
    lModel.shaderList[j] )
    end repeat
    end repeat



    "Raki" <chris_fowler_hotmail.com> wrote in message
    news:bgqsqn$ai1$1forums.macromedia.com...
    yeah the code works but it shades everything

    code poorly copy and pasted below: But basically it shades every shader in
    the list otherwise if one of the txtures isn't blended then it won't alpher
    problem. But is there a way to restrict it to the model in question rather
    than a generall all models that use that shader?

    ================================================== ===
    if pBlend > pAlpha_min then
    repeat with x = 1 to pModel_alphad.shaderlist.count
    if pBlend + pBlend_modifier <= pAlpha_min then
    pModel_alphad.shaderlist[x].blend = pAlpha_min
    pBlend = pModel_alphad.shaderlist[x].blend
    else
    pModel_alphad.shaderlist[x].blend = pBlend - pBlend_modifier
    pBlend = pModel_alphad.shaderlist[x].blend
    end if
    end repeat
    end if
    if pBlend <= pAlpha_min then
    pAlpha_timeout.forget()
    repeat with x = 1 to pModel_alphad.shaderlist.count
    pModel_alphad.shaderlist[x].blend = pBlend
    end repeat
    end if

    ================================================== =======

    Chris

    "hairybobby" <webforumsusermacromedia.com> wrote in message
    news:bgqq01$5ai$1forums.macromedia.com...
    > try using shader.blend
    >
    > as in the example
    >
    > [url]http://www.geocities.com/hairybobby2000/barcode.html[/url]
    >
    >
    >
    > HAIRYBOBBY - why didn't I choose a really cool name like the vulcanpimp
    >
    > [url]http://www.geocities.com/hairybobby2000[/url]
    >
    > Photograpghy section
    >
    > [url]http://www.geocities.com/hairybobby2000/px1.html[/url]
    >
    > Photoshop section
    >
    > [url]http://www.geocities.com/hairybobby2000/photo1.html[/url]

    Patrick Hogan Guest

  5. #5

    Default Re: Re:Alphering the shader groups of a model to make it 50% transperant but not anyof the others...

    As I import this file from a max file, would I have to create a separate
    texture map for each building as such so only they alpha?

    Chris

    "Patrick Hogan" <patrickgemdo.com> wrote in message
    news:bgquip$ec9$1forums.macromedia.com...
    > It's not possible to set model transparency. It has to be done on shader
    > level and it will affect all models using the same shader. The best
    solution
    > is to replace all the shaders of all your models (or at least of those you
    > intend to tweak uniquely) with duplicate shaders. I'm not sure if the
    > duplicate() function works on shaders. You may have to write your own
    > function for it. Roughly you'd do something like:
    >
    > -- skip first model, process all others
    > repeat with i = 2 to pScene.model.count
    > lModel = pScene.model[i]
    > -- duplicate all shaders for this model
    > repeat with j = 1 to lModel.shaderList.count
    > lModel.shaderList[j] = MyFunctionToDuplicateShaders(
    > lModel.shaderList[j] )
    > end repeat
    > end repeat
    >
    >
    >
    > "Raki" <chris_fowler_hotmail.com> wrote in message
    > news:bgqsqn$ai1$1forums.macromedia.com...
    > yeah the code works but it shades everything
    >
    > code poorly copy and pasted below: But basically it shades every shader in
    > the list otherwise if one of the txtures isn't blended then it won't
    alpher
    > problem. But is there a way to restrict it to the model in question rather
    > than a generall all models that use that shader?
    >
    > ================================================== ===
    > if pBlend > pAlpha_min then
    > repeat with x = 1 to pModel_alphad.shaderlist.count
    > if pBlend + pBlend_modifier <= pAlpha_min then
    > pModel_alphad.shaderlist[x].blend = pAlpha_min
    > pBlend = pModel_alphad.shaderlist[x].blend
    > else
    > pModel_alphad.shaderlist[x].blend = pBlend - pBlend_modifier
    > pBlend = pModel_alphad.shaderlist[x].blend
    > end if
    > end repeat
    > end if
    > if pBlend <= pAlpha_min then
    > pAlpha_timeout.forget()
    > repeat with x = 1 to pModel_alphad.shaderlist.count
    > pModel_alphad.shaderlist[x].blend = pBlend
    > end repeat
    > end if
    >
    > ================================================== =======
    >
    > Chris
    >
    > "hairybobby" <webforumsusermacromedia.com> wrote in message
    > news:bgqq01$5ai$1forums.macromedia.com...
    > > try using shader.blend
    > >
    > > as in the example
    > >
    > > [url]http://www.geocities.com/hairybobby2000/barcode.html[/url]
    > >
    > >
    > >
    > > HAIRYBOBBY - why didn't I choose a really cool name like the vulcanpimp
    > >
    > > [url]http://www.geocities.com/hairybobby2000[/url]
    > >
    > > Photograpghy section
    > >
    > > [url]http://www.geocities.com/hairybobby2000/px1.html[/url]
    > >
    > > Photoshop section
    > >
    > > [url]http://www.geocities.com/hairybobby2000/photo1.html[/url]
    >
    >

    Raki Guest

  6. #6

    Default Re: Alphering the shader groups of a model to make it 50% transperantbut not anyof the others...

    So the answer is that many shaders (with different blend values) can
    use the same texture. No prob with that ;)
    --
    Agustín María Rodríguez | [email]agustinOnWine.com.ar[/email] | [url]www.OnWine.com.ar[/url]

    Agustín María Rodríguez Guest

  7. #7

    Default Re: Alphering the shader groups of a model to make it 50% transperant but not anyof the others...

    Okie I'll get my level builder onto it maybe he can have 3-4 separate
    textures set up to use near each other so you can't ever tell that another
    building using the same texture is alphering at that time (due to camera
    culling)

    Chris

    "Agustín María Rodríguez" <agustinonwine.com.ar> wrote in message
    news:bgtbud$lek$1forums.macromedia.com...
    > So the answer is that many shaders (with different blend values) can
    > use the same texture. No prob with that ;)
    > --
    > Agustín María Rodríguez | [email]agustinOnWine.com.ar[/email] | [url]www.OnWine.com.ar[/url]
    >

    Raki Guest

Similar Threads

  1. Replies: 0
    Last Post: September 11th, 02:27 PM
  2. Reseting a shader for a model
    By dn580 in forum Macromedia Director 3D
    Replies: 1
    Last Post: September 2nd, 05:13 AM
  3. make model ignore collision from modelsUnderRay
    By Michaelcov in forum Macromedia Director 3D
    Replies: 3
    Last Post: February 7th, 07:03 PM
  4. 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
  5. As it is possible to make LightMap for model and to export in W3D ?
    By Artur_R in forum Macromedia Director 3D
    Replies: 0
    Last Post: August 11th, 07:44 AM

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