Jump to content

Recommended Posts

Posted

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?

Posted

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()

Posted

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

Posted
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

Posted

*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.

Posted

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!

  • 2 weeks later...
Posted

Is there any fix for this? I am having the same issue but on a model. The texture is 512*512 and contains transparency, material blend mode is set to alpha and appears fine in the 'viewer' but not in the engine.

 

Screen_Shot_2013_04_08_at_20_41_40.png

Posted

There isn't really any foilage shaders yet but by modifying an exiting one

you can do an alphatest by adding this right below outcolor * = texture2d...

if (outcolor.a<0.5) discard;

  • Upvote 1

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Posted

There isn't really any foilage shaders yet but by modifying an exiting one

you can do an alphatest by adding this right below outcolor * = texture2d...

if (outcolor.a<0.5) discard;

 

This will work fine for now. Thanks

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.

×
×
  • Create New...