  | | | 2nd texture layer woes | 2nd texture layer woes 2003-11-18 - By nick kang
Back
Agust�n,
Not sure why it doesn't work in your example, but you don't have to add the meshDeform and textureLayer if you just want to stick another texture in one of the textureLayers. Try taking those calls out and it should work:
on addSeams scene --loop through the 3 models repeat with modelNum = 1 to scene.model.count modelRef= scene.model[modelNum] seamTexture = createSeamTexture(scene,modelRef) seamShader = modelRef.shader -- THIS WAS MOVED BELOW -- seamShader.transparent = FALSE --I need it off cuz Z-fighting seamShader.textureList[2] = seamTexture seamShader.textureList[2].renderFormat = #rgba8888 seamShader.blendFunctionList[2] = #blend seamShader.blendSourceList[2] = #alpha end repeat updateStage repeat with i = 1 to scene.model.count scene.model[i].shader.transparent = FALSE end repeat end
Also, if you want to avoid flickering, try to keep your texture updates to only the first layer. Or in this case, you can just postpone setting the 'transparent = FALSE' until after renders once.
Hope this helps, -nick
-- --Original Message-- -- From: dir3d-l-bounces@(protected) [mailto:dir3d-l-bounces@(protected)] On Behalf Of Agust�n Mar�a Rodr�guez Sent: Monday, November 17, 2003 10:21 PM To: dir3d-l@(protected) Subject: [Dir3d-l] 2nd texture layer woes
Hi all! I�ve run into a strange issue (bug? I remember Barry complaining about textureCoordinates some time ago). I�m adding a second layer to some meshes for putting textures with alpha channel. The problem is that the textures doesn�t show at all unless I set its mode to #wrapPlanar and then back to #none, so I use the first layer�s coordinates.
Here�s a little demo with some lines of the code I�m using www.onwine.com.ar/temp/pocket-2 (See http://ket-2.ora-code.com)nd_layer_messed.zip (256kb)
on addSeams scene --loop through the 3 models repeat with modelNum = 1 to scene.model.count
modelRef= scene.model[modelNum]
modelRef.addModifier(#meshDeform) --#meshDeform updateStage modelRef.meshDeform.mesh[1].textureLayer.add() --add a 2nd layer
seamTexture = createSeamTexture(scene,modelRef) seamShader = modelRef.shader seamShader.transparent = FALSE --I need it off cuz Z-fighting
--Remove this line and it won�t work! seamShader.textureModeList[2] = #wrapPlanar --use planar mapping
seamShader.textureList[2] = seamTexture updateStage
seamShader.textureList[2].renderFormat = #rgba8888 seamShader.blendFunctionList[2] = #blend seamShader.blendSourceList[2] = #alpha
--Remove this line and it won�t work! seamShader.textureModeList[2] = #none --back 2 orig coords
updateStage end repeat end
That workaround I�ve found works fine on authoring mode for all the models I have in the complete scene but it fails in one when running as a projector. I�ve tried to track down this one but I couldn�t find which difference may be between running the same movie as projector or author.
So the question is: how could I avoid using my textureModeList workaround? There is another one? Am I doing something wrong? I�ve also tried using PNG and TIF; setting the 2nd layer coordinates equal as the 1st channel ones and some other thingies.
Thanks for your help. -- Agust�n Mar�a Rodr�guez | agustin@(protected) | www.OnWine.com.ar
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ Dir3d-l mailing list Dir3d-l@(protected) http://nuttybar.drama.uga.edu/mailman/listinfo/dir3d-l
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ Dir3d-l mailing list Dir3d-l@(protected) http://nuttybar.drama.uga.edu/mailman/listinfo/dir3d-l
|
|
 |