WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-01-2005, 02:10 PM
vjosh vjosh is offline
Member
 
Join Date: Sep 2004
Posts: 17
Overlaying Textures with Alpha Masks

Hey,

I need to overlay one or more textures with alpha masks on top of an object's original texture within Vizard. Will multitexturing work for this? What blend settings should I use? Ideally, the alpha masks on the additional textures would dictate how the textures are blended...

I'm also having problems with texturing faces. I looked at a previous post that suggested using the following code in order to make the texture coordinates work:
newtexture = viz.add(texture)
newtexture.wrap(viz.WRAP_S,viz.REPEAT)
newtexture.wrap(viz.WRAP_T,viz.REPEAT)
This works when applying the texture to the default layer (textureNum 0) with the following code for example:
self.head.texture(newtexture, 'geom_0')
But it doesn't seem to work correctly for code like this (regardless of how I blend the textures afterwards):
self.head.texture(newtexture, 'geom_0', 1)
Any suggestions?

Thanks!

-Josh
Reply With Quote
  #2  
Old 04-01-2005, 03:17 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi Josh,

Take a look at the following forum post:

http://www.worldviz.com/forum/showth...3?threadid=141

At the very end of the post I include a link to a plugin that allows the user to specify a grayscale mask for blending two textures. If this doesn't suit your needs then let me know exactly what you want and I'll change it for you.
Reply With Quote
  #3  
Old 04-01-2005, 03:35 PM
vjosh vjosh is offline
Member
 
Join Date: Sep 2004
Posts: 17
Hey Farshizzo,

Thanks. I might need something a little more... I'm trying to overlay a few mud splotches on top of the default texture of an object, but they need to be erasable on an individual basis. It seems the easiest way would be to create images of mud spots on individual textures with alpha masks so the original texture shows through. Then I could just remove each individual mud spot by removing the particular texture. Does this sound feasible?

I suppose the grayscale mask could be made to work (though probably a bit more cumbersome). But I need to be able to blend an arbitrary number of textures...

Thanks again!

-Josh
Reply With Quote
  #4  
Old 04-01-2005, 03:44 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi Josh,

What is the maximum number of textures you will be applying at a time? The reason I ask is because your video card has a limit to the number of textures you can apply to an object. Usually this limit is 4.
Reply With Quote
  #5  
Old 04-01-2005, 04:00 PM
vjosh vjosh is offline
Member
 
Join Date: Sep 2004
Posts: 17
Hey Farshizzo,

I'm not sure what the limit is on the video card I'll be using. If the limit is 4 then that will have to suffice. Otherwise, it'd be nice to have as many as 10 or so. Is the limit in effect for each geom subchild or does it count against the object as a whole?

-Josh
Reply With Quote
  #6  
Old 04-01-2005, 05:21 PM
vjosh vjosh is offline
Member
 
Join Date: Sep 2004
Posts: 17
Oh, one thing I forgot to mention... It would be nice to be able to change the opacity of the mud texture dynamically if possible (i.e. make it fade away). If there's no easy way to do this then I suppose I could use multiple textures with slightly different alpha masks.

Thanks!
Reply With Quote
  #7  
Old 04-05-2005, 10:55 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi Josh,

Do you need to postion these textures at a specific point on the object or just apply it onto the entire object? Also, is the object that you want to apply these textures flat or curved?
Reply With Quote
  #8  
Old 04-06-2005, 07:46 PM
vjosh vjosh is offline
Member
 
Join Date: Sep 2004
Posts: 17
Hey Farshizzo,

The object(s) will be curved. In fact, one particular object will be a human (so I'll need to be able to texture custom faces as well). I'm not sure what placing the textures at a point would involve. Perhaps the most straightforward way for me is to look at whatever texture is currently being used for an object and draw in what I need at a particular location on the texture (while alpha masking everywhere else). So it'd be great if the overlaid textures were mapped over the existing texture in the same exact way.

Thanks!

-Josh
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:24 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC