Alpha transparency borders on dynamically loaded images for use with textures

Hi there folks. Well, I have been beating my head over this
and am hoping one of you can help me out.
Essentially I have 16bit images that are loaded into my
shockwave application at run-time. These images are user defined
which means that I will not know their size ahead of time. Once the
images are loaded I then create textures and apply them to various
shaders. Ok, all of this works just fine. What I need to do though
is create an alpha transparent border around the images, so when I
apply them to their surfaces I only see the image and nothing
around it. I am doing this because these images will only appear at
specific parts on a surface, textureRepeat will be false, and many
models will be stacked in the same exact location using the same
model resource. I have everything working, but I cannot figure out
the alpha part for the life of me. Also, when I test the alpha
based image by itself it works just fine. It is not until I try and
combine the 16bit (converted to 32bit at run-time) image that I run
into problems.
I have tried:
- Creating a 32bit alpha image in Fireworks with a
transparent border and a black rect for the inside. I then copy the
dynamic image over the alpha image (only after going from 16bit to
32bit in imaging Lingo) and leave a little room at the edges for
the transparency. Well, I get a crazy amount of streaks here even
when I try to up the trans border by around 24 pixels on each side.
- Using another similiar alpha based image as a mask with
copyPixels and extractAlpha/setAlpha like this... (code is a little
rough here)
newImage = new(#bitmap)
newImage.name = "place_Test"
newImage.image = member("place").image
newAlpha = new(#bitmap)
newAlpha.name = "AHH"
newAlpha.image = image(newImage.image.width + 24,
newImage.image.height + 24, 32)
newAlpha.image.useAlpha = true
newAlpha.image.copyPixels(member("vase").image,
newAlpha.image.rect, member("vase").image.rect)
newAlphaInfo = newAlpha.image.extractAlpha()
newAlpha.image.useAlpha = false
--reverse dark to light
iAlphaReverse = image(newAlpha.image.width,
newAlpha.image.height, 8, #grayscale)
iAlphaReverse.fill(iAlphaReverse.rect, rgb(0,0,0))
iAlphaReverse.copyPixels(newAlphaInfo, iAlphaReverse.rect,
newAlphaInfo.rect, [#ink : #reverse])
--newAlphaInfo.copyPixels(iAlphaReverse, newAlphaInfo.rect,
iAlphaReverse.rect, [#ink:#subtractpin])
newAlphaMask = iAlphaReverse.createMask()
rescaleAbs(newImage, newImage.image.width,
newImage.image.height, "place_Test", 32)
destImage = member("place_Test").image.duplicate()
destImage.fill(destImage.rect, rgb(0,0,0))
newAlpha.image.useAlpha = false
destImage.copyPixels(newImage.image, newImage.image.rect,
newImage.image.rect, [#maskImage:newAlphaMask, #ink:#add])
destImage.setAlpha(iAlphaReverse)
destImage.useAlpha = true
member("place_Test").image = destImage
I apologize for the messy code. I have cut and pasted from
all over the place and am getting confused. In any case, I think I
am making this harder then it needs to be and hope someone can
help.
Thank you in advance,
Dave

Hi, you can try using other texture layer as mask on the same
shader. As usually you create the texture from a dynamic loaded
image, then apply this texture to the shader on the texture list
index 1 (textureList[1]). Next part does the job, create other
texture from a 32 bits image with the alpha information and fill
all pixels with white color, this is very important because the
second texture layer will be multiply with the first texture layer.
This texture set its render format to rgba8888. Apply the mask
texture to the same shader at texture list index 2, verify that the
blendFunctionList index 2 is #multiply.
I include the code of a project that use this masking
approach:
property pMember
property pEarthSphere
property pNightSphere
property pLastTransform
on beginSprite me
pMember = sprite(me.spriteNum).member
me.setupWorld()
end
on setupWorld(me)
pMember.resetWorld()
repeat with i = pMember.light.count down to 1
pMember.deletelight(i)
end repeat
vEarthModelResource = pMember.newModelResource("EARTH MODEL
RESOURCE", #sphere)
vEarthModelResource.radius = 50.000
vEarthModelResource.resolution = 20
vEarthTexture = pMember.newTexture("EARTH TEXTURE",
#fromCastMember, member(3,1))
vEarthShader = pMember.newShader("EARTH SHADER", #standard)
vEarthShader.emissive = color(255,255,255)
vEarthShader.flat = TRUE
vEarthShader.transparent = FALSE
vEarthShader.textureList[1] = vEarthTexture
pEarthSphere = pMember.newModel("EARTH MODEL",
vEarthModelResource)
pEarthSphere.shaderList = vEarthShader
vNightModelResource = pMember.newModelResource("NIGHT MODEL
RESOURCE", #sphere)
vNightModelResource.radius = 50.2000
vNightModelResource.resolution = 20
vNightTexture = pMember.newTexture("NIGHT TEXTURE",
#fromCastMember, member(4,1))
vNightTexture.quality = #lowFiltered
vNightTexture.nearFiltering = FALSE
vNightTexture.renderFormat = #rgba8880
vNightShader = pMember.newShader("NIGHT SHADER", #standard)
vNightShader.emissive = color(255,255,255)
vNightShader.flat = TRUE
vNightShader.transparent = TRUE
vNightShader.textureList[1] = vNightTexture
vMaskNightTexture = pMember.newTexture("MASK NIGHT TEXTURE",
#fromCastMember, member(6,1))
vMaskNightTexture.renderFormat = #rgba8888
vNightShader.textureList[2] = vMaskNightTexture
vNightShader.textureModeList[2] = #wrapPlanar
pNightSphere = pMember.newModel("NIGHT MODEL",
vNightModelResource)
pNightSphere.shaderList[1] = vNightShader
pNightSphere.parent = pEarthSphere
end
on exitFrame(me)
pEarthSphere.rotate(0.0,0.1,0.0)
me.moveMaskNightTexture()
end
on moveMaskNightTexture(me)
vRotationVector = - pEarthSphere.transform.rotation
pNightSphere.shaderList[1].wrapTransformList[2].rotation =
vRotationVector
end

Similar Messages

  • Does anyone know where I can get some images for use with Titler Pro 3?

    I am really just trying to get some effects like honeycomb or different color washes for reflections.  Maybe explosions.  They are all put to use from a image if I am not mistaken, new to Titler Pro 3.

    That is not an Adobe program... ask the company that sells that program... NewBlueFX | Best-selling, easy-to-use video editing plugins

  • How to dynamically load images into Flash

    I have a movie clip on the stage that I want to dynamically
    load images into (that constantly change), how would I go about
    doing this? Thanks.

    Use the Loader class to load in images.
    Then use addChild to add the Loader class into your MovieClip
    on the stage.
    As far as "constantly change" what
    do you mean by that? You could use setInterval, ther enterFrame
    event, or any other means to trigger a new image to be loaded into
    the Loader instance.
    Finally, you can use the Tween class to create some nice
    effects for the images (fade it, blur in, photo blend, masks,
    etc)

  • Dynamically loaded images cached?

    We have an xml feed that is refreshed every hour. According
    to the xml file, we dynamically load an image into an html text
    field each time someone hits our page. All of the images have been
    recently updated, but the old ones are still appearing? We use the
    swf?nocache=randomnumber convention to make sure the swf file
    itself isn't cached, but is there anything we can do to clear out
    the cache of dynamically loaded images? If there isn't anything we
    can do, will these all eventually refresh themselves? This is how
    the html is generated where "twcImage[0]" is the image in question.
    Thanks!

    Do the same random number for the images.
    twcImage[0] + randomnumber
    Dan Smith > adobe community expert
    Flash Helps >
    http://www.smithmediafusion.com/blog/?cat=11
    http://www.dsmith.tv
    "Wolli World" <[email protected]> wrote in
    message
    news:fvvcrc$k9o$[email protected]..
    > We have an xml feed that is refreshed every hour.
    According to the xml
    > file,
    > we dynamically load an image into an html text field
    each time someone
    > hits our
    > page. All of the images have been recently updated, but
    the old ones are
    > still
    > appearing? We use the swf?nocache=randomnumber
    convention to make sure
    > the swf
    > file itself isn't cached, but is there anything we can
    do to clear out the
    > cache of dynamically loaded images? If there isn't
    anything we can do,
    > will
    > these all eventually refresh themselves? This is how the
    html is
    > generated
    > where "twcImage[0]" is the image in question. Thanks!
    >
    > twcTarget.text = "<img align='left' hspace='5'
    vspace='0' src='
    http://" +
    > _root.server + "/rss/weather/images/" +
    > twcImage[0] + "'>" + "<condition>" + ... and so
    on
    >

  • Get width and height of a dynamically loaded image once it's done loading?!

    hello : :
    well... i'm taking my first shots at flex after programming
    in flash for a year now. it's been fun and i've been picking up on
    things pretty well (or so i think), but i come across something
    today that i used to be able to do in my as2 programming and don't
    know how to do in as3...
    in flex, i'm loading an image into an image control (by using
    "myImgControl.load(urlString)"). i have a "complete" parameter on
    the image control that calls a function just fine after the image
    is loaded, but if i try and check the hight and width of the loaded
    image once it loads, it comes back as zero. how can i get the
    height and width of the image after it's loaded?!
    in flash/as2 i used to do this little trick/work-around i
    found in a forum (kirupa.com, i think) to find out the width and
    height once the loaded image listener checked the loading process
    and came back "complete"... in the code below, "imgLoader" is the
    movieClip the image was loaded using
    imgLoaderListener.loadClip(urlString, imgLoader).
    quote:
    iTot = imgLoader.getBytesTotal();
    iLoad = imgLoader.getBytesLoaded();
    if (iLoad == iTot && iTot > 4) {
    imgH = imgLoader._height;
    imgW = imgLoader._width;
    that all make sense?!
    basically, it's as simple as this: i need to find something
    similar to the above for as3 that will tell me the width and height
    of a dynamically loaded image after it's done loading...
    so there ya have it. i appreciate any help any of you can
    throw my way! thank you so much for even reading this!
    : : michael

    I assume you have probably already figured this out, but just
    in case, there should be an event to listen for after which you can
    get the height and width information successfully. I can't remember
    the exact name, however. Experiment and see which one works
    time-wise.

  • Dynamically loading images: UI Loader issue

    I posted this last week, but did not show good examples to get help. Admittedly, I am new to flash, so this may be a bit elementary, so my apologies in advance. I am trying to dynamically load images through the UI Loader component. Attached are the errors I get, and although I think that the coding is close to correct, when I publish, it just flashes up then restarts the movie... any ideas? Thanks in advance.

    there's a problem attaching things to this forum.  so, nothing is attached.
    can you copy and paste your error messages to this forum?

  • Has anyone created an animated loading image for a WebApp?

    I have a complex WebApp that takes a few seconds to load.  Does anyone have an example of a loading image for WebApps?

    Lots of choice
    Google

  • Mail: Load Images for trusted senders

    Hi,
    Within mail / Preferences, I've disabled loading images for all received email. However, I'd like to be able to automatically load images for any sender in my address book or use some other whitelist mechanism to trust certain senders so that I don't have to "load images" so often. Any ideas?
    Thanks,
    Robert

    This may be a question for the Apple Script forum, as mail rules has the capacity to run an apple script based upon set criteria.
    Something like:
    on new received message > checked senders > if sender is in address book > run apple script to load images.
    If I was an apple script type I might be able to help, sadly though I am not.
    Try posting here: http://discussions.apple.com/forum.jspa?forumID=724
    I hope you find a successful solution.
    Cheers!
    Michael

  • What's the best way to save an 8.5 x 11 image for use as a page background in a PDF?

    What's the best way to save an 8.5 x 11 image for use as a page background in a PDF? My goal is to have a relatively small final .pdf file size that includes numerous pages with full 8.5 x 11 images as backgrounds in the document. If I save at 8.5 x 11 and 72dpi (example), the image is not 8.5 x 11, and the quality is not good enough. I need help with size, dpi, and file format to save as before I place it in InDesign and then save as a .pdf.
    Thanks,
    Jim

    Do exactly what I said then.  Create the InDesign document of the required dimension, and chose whether it will be high quality print, or Interactive PDF.  It really doesn't mater what format you bring the image into that document.  It can be JPG, PNG, but I usually use native Photoshop PSD.  The image does have to be of high enough resolution, but it can be many times bigger than iis required for the final export.  (InDesign does not import the image, but rather references it on your hard drive.)
    When you have placed your text and finished your page, then export it to PDF, but go through the tabs chosing suitable settings.  If the image needs to be downsized, InDesign will do that at this stage while building the PDF.
    If you can tell us how this presentation will be made (Projector, overhead projector, printed page etc. or just emailed to the end users) we can help you more with the final output settings. 

  • IPad:  Any advice on getting a pre-loaded Sim for use overseas (Europe)?

    iPad:  Any advice on getting a pre-loaded Sim for use overseas (Europe)?

    Thanks, I thought this was the case, checking to see if anything had changed.  Spain is the country in question.  We previously were not able to obtain a Sim there but that may have been because of a carrier or individual employee problem.  Will certainly try again next time (we did get a carrier Sim successfully in Italy one time).  Cheers

  • How does one transfer CS5 actions for use with CS6?

    CS6 installation, which was uneventful, has transferred none of my actions from my copy of CS5. The CS5 actions are located in the actions folder of the APPLICATION/PHOTOSHOP CS5/PRESETS/ACTIONS.  The "actions" folder in application support/adobe in my library is empty, and has always been so.
    Only the CS6 default actions are located in the same folder for CS6.
    I use imac i7, lion.
    Note that i also have CS3 and CS4 on my machine. This due to recent upgrade to CS5 and recent upgrade to LION, and my general paranoia.
    Must i load each action into CS6, one at a time?
    thanks to any and all.
    vince

    Re: how does one transfer CS5 actions for use with CS6?
    On a Mac - There are multiple ways to do this.  I have done them both ways. In order to do this you need to know where you have your actions stored, and you can move them all at once if you have them stored in the same location.
    1. You can load an action ONE AT TIME into your actions palette by:
         A. Open up the action palette and click on the little arrow with 4 little horizontal lines next to it on the upper right corner of the actions palette.
         B. Select "Load Actions" and a Finder window will open up and you can search your computer through this window for your actions.
         C. Click on the action from the Finder window then click 'Open' at the bottom right of the finder window.
         D. To save these so that they appear every time you open up your actions palette, go back to the little arrow at the top right of the actions palette and when the drop down window opens- click on 'Save Actions'. It will select the location where the          actions are currently stored as the place to save them. If you want to change that path, you can do it at this time in the little path window.  I just leave it, since I keep all my actions stored in the same file.
    2. TO MOVE MULTIPLE ACTION SETS AT ONCE
         A. Open up CS6 (or CS5) and move the Photoshop workspace it to the right side of your computer screen so you can see your desktop on the left side.
         B. Open up your Finder search window from your dock (the square blue head icon thingy for those who are new to photoshop). Move this to the left side of your screen so you can see the Photoshop work space on the right and the Finder window          on the left. In the Finder window, navigate to the file where all your actions are stored, select all the actions in the file (command+A will select everything in the file if you are actively inside the open file) or you can select multiple files           individually by continuously holding down the command key and clicking on the different actions you want to move.
         C. With the Photoshop workspace visible on the right, and the actions palette open so you can see that the actions actually transferred - In the Finder window, click the selected actions you want to load and drag them over to the Photoshop           workspace.  I did this without an image open, I just dragged them onto the empty workspace.  The actions should all appear immediately in the actions palette that is open.
         D. To save these so that they appear every time you open up your actions palette, go back to the little arrow at the top right of the actions palette and when the drop down window opens click on 'Save Actions'. It will select the location where the           actions are stored as the place to save them. If you want to change that path, you can do it at this time in the little path window.  I just leave it, since I keep all my actions stored in the same file.
    I hope this helps. 
    and I hope there are no typos. 

  • Best drum loops for use with Logic? Ease of use, usability, etc.

    Hi,
    I have BFD2 but find it slow to load and sometimes clumsy auditioning loops within Logic. I love the Apple Loops library but I wondered if people are importing MIDI drum files for use with Logic. Do all drum files use the same MIDI mapping? If I drop a BFD2 loop into a Logic drum virtual instrument will it work? I bought a few packs from Groove Monkee but have yet to use them with Logic. I only use them within BFD2.
    I'm basically looking for a seamless way to stay within Logic to improve my workflow. It's taken me days sometimes to get a drum track right by going back and forth with BFD2. Is there a concept I'm missing that would make it easier?
    Thanks

    try Stylus RMX by Spectrasonics. http://www.youtube.com/watch?v=FlgP1q1HCj4

  • Partitioning an External 320gb drive for use with Time Machine and...

    I want to be able to use my Western Digital 320GB external drive for use with Time Machine and to use as extra storage space on both my Mac and when I boot into Windows Vista.
    Is this possible?
    I was playing around in Disk Utility and would I partition the part I want to use for Time Machine with the Mac OS Journaled, and whatever I want as space for windows, use a MS - DOS format?
    Has anyone done this before?
    Cheers-

    Unless you are using 64 bit version of MSWindows (64 bit XP/Vista), it won't be able to handle a disk with GUID partition table (GPT). Disks with Apple Partition Map (APM) or GUID partition table are the only ones that Time Machine will work with (not MBR disks). Note also that the MBR/APM/GPT are at the DISK level and not the partition level, so don't mix the format with partitioning scheme. Time Machine disks are meant to live in the Mac universe (for now, anyway) and sharing with the MSWindows 32-bit universe is not possible.
    See http://img87.imageshack.us/my.php?image=macpcdiskdd06sv8.png for some additional background.

  • Extract closed captions from OTA HD broadcast for use with DVD SP?

    Hi, I'm out of my league here, trying to do a favor for a deaf friend. He will appear on a national TV show, and I'd like to capture his appearance and (if possible) burn it to DVD.
    Of course, being deaf, he needs to see the closed captions.
    What I've done so far is buy Elgato's eyeTV Hybrid. I can successfully capture HD broadcasts with their embedded closed captions (wow, is that gorgeous!).
    I can use the eyeTV software to recompress the audio and video for DVD SP, but the captions don't end up anywhere that I can tell.
    Is there any way to extract the closed captioning information for use with DVD SP?
    Thanks very much.

    I don't think FCP will ever have captioning tools, due to it is a specilized area of post production and third party companies have developed captioning software that addresses this area.
    I use the only Mac captioning software, (Mac Caption, made by CPC) that runs on the Mac. The cost for the SD captioning version of Mac Caption retail cost $6,995 USD and the HD version is an additional $2000.00 USD. If your an educational institution, then the price is about half the list, (price can be negotiated with the company at the time of purchase.)
    As you can see, this is about half the cost of the FCP suite and I really don't think that Apple will ever get into this area. Most production companies rely on captioning services. In our case, we are an educational facility and therefore must comply with ferderal law, so we caption everything we do, thus why we had to purchase our own software.
    The software we use, can do what it is that you are seeking, it can read the caption data from a live video image an convert it to a .scc file, that can be then used in DVD authoring or tape production. It can also read the raster area of a 720x 486 video file and also convert the caption information to a .scc file, as well as creating subtitlilng .stl files for DVD's.
    It can also do original captioning, as well as add a text track to QT streaming files, which is how you caption QT steraming files. You can even burn captions into the video image of a steaming file.
    Again, most production facilities are going to have to rely on a captioning service, but because we have to caption everything, and most captioning services don't caption QT streaming files, this was another reason we had to purchase our own captioning software.

  • Third party encoding for use with iDVD?

    Hello All,
    I have been doing a little bit of research on this, but I think I need some answers from more experienced users.
    Are there any third party apps that do a better quality job of encoding video for use with iDVD? I edit my videos in Final Cut Express and then I import to iDVD and while the quality is OK I wonder if I can get it to look better ( I use SD footage and I encode in Professional Quality).
    Has anyone here used a third party app that does a better job? (faster and/or better image quality)
    Thanks for your help.
    Mike

    Mike - Be sure and double-check over in the FCE forum to make sure you're using the best settings to make the jump from FCE to iDVD.
    The Pro algorithm is supposed to be iDVD's best setting (for all production lengths), if you have a shorter production (under 60 min), try using Best Performance and see if that gives you anything better.
    John

Maybe you are looking for

  • Adobe Reader XI - javascript alert boxes appearing behind modal IE window

    Hi - I am experiencing the following issue: I am running Windows 7,  Internet Explorer 9 and Acrobat Reader XI. I am opening a pdf document in an IE modal dialog usiing the showModalDialog() function. My pdf document has a simple button which will di

  • Conversion XML-Text atom

    Hi all I have developed a scenario step which reads txt files from a directory and generates journal vouchers based on the data in the files. This is made using the file inbound and specifying a control document for mapping values in the file to xml.

  • Is it possible to set a bookmar for BT Email (@bti...

    Hi All my searches for info on this seem to always end up with info on the older BT Yahoo email rather than the @btinternet email.  I would rather have a bookmark straight through to BT Email rather than having to log in to MyBT and then access the B

  • How to force a responsive Edge animation to re-evaluate its container size?

    I have an Edge animation stage embedded in a relatively complex page, inside a container div whose width is set by media queries and which may or may not be faded out by $.fadeOut. I've figured out how to trigger playback, but the stage doesn't seem

  • Can Pages write two numbers one over another, like atomic number and mass?

    Is it possible in Pages 08 to write two numbers right atop one another like you do for atomic number and mass number? One a bit under the line, one a little over the line, both at the same place (not one after the other)? I haven't found out how to t