Jump to content

CSG with material that has transparency on it


Rick
 Share

Recommended Posts

Is it possible to have a texture with transparent spots, have that transparency be applied when painted onto a CSG model? I have this situation, make a lightmapped material for it, but it on the model and the transparent parts show up as white. Any ideas?

Link to comment
Share on other sites

Any ideas on just a box I made:

 


self.buttonMaterial = Material:Load("UI/round_button.mat")
self.button = Model:Box()
self.button:SetScale(1, 1, .1)
self.button:SetPosition(0, 0, 1.54)
self.button:SetMaterial(self.buttonMaterial)

 

The same material has black for transparency on a Model:Box()

Link to comment
Share on other sites

Hi rick, when you say the texture has black for transparency, are you meaning that's what's happenng as apposed to being transparent or the areas black are what you want transparent?

 

As far as I'm aware the transparency is picked up from the alpha channel of the image (not black areas)

 

Also shouldn't you have z-sort checked for transparent mats?

 

Andy

The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do.

 

Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d

Link to comment
Share on other sites

So this is working on PC. On mobile the cube is just all white. No texture at all

This is just a wild guess, but is your texture by any change non power of two, or square, Rick? I remember having the same kinda 'white texture' issue a while back when I was developing a game with a good friend of mine. Best to keep your textures powers of two (64x64, 128x128, 256x256, 512x512, etc...) and in some cases even not rectangular. Depends on the device, I think. smile.png

 

ZBrush 4R7 64-bit - 3DCoat 4.5 BETA 12 - Fl Studio 12 64Bit - LE 3.2 Indie version - Truespace 7 - Blender 2.71 - iClone 5.51 Pro - iClone 3DXChange 5.51 pipeline - Kontakt 5 - Bryce 7 - UU3D Pro - Substance Designer/Painter - Shadermap 3 - PaintShop Photo Pro X7 - Hexagon - Audacity - Gimp 2.8 - Vue 2015 - Reaktor 5 - Guitar Rig 5 - Bitmap2Material 3

Link to comment
Share on other sites

*sigh* this is frustrating. When I made it 256x256 I see it on PC but I can't see the cube at all on mobile. It's there, because picking works on it, but just can't see it sad.png

 

The strange thing is now, I resized the image back to 300x300 just to test, but when I import into LE3 it says it's 256x256 still. Not sure if LE is resizing it to nearest power of 2 or what.

Link to comment
Share on other sites

lol now when I Run on mobile I get error: Error: Failed To Load file "C:/Leadwerks/Projects/MyWhackyMoles/Projects/Android/libs/armeabi/sta93584".

 

 

but now I see the mesh and the right transparent texture. wtf lol

 

 

Thanks Chris!

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...