Rick Posted March 27, 2013 Share Posted March 27, 2013 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? Quote Link to comment Share on other sites More sharing options...
shadmar Posted March 27, 2013 Share Posted March 27, 2013 In mat editor, select BlendMode : Alpha Works for me on csg geometry using alpha material. 1 Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Pancakes Posted March 27, 2013 Share Posted March 27, 2013 Let's just make an "Ask shadmar" thread 1 Quote Core I5 2.67 / 16GB RAM / GTX 670 Zbrush/ Blender / Photoshop CS6 / Renoise / Genetica / Leadwerks 3 Link to comment Share on other sites More sharing options...
Rick Posted March 27, 2013 Author Share Posted March 27, 2013 Once again shadmar you come to the rescue! Thanks! Quote Link to comment Share on other sites More sharing options...
Rick Posted March 27, 2013 Author Share Posted March 27, 2013 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() Quote Link to comment Share on other sites More sharing options...
shadmar Posted March 27, 2013 Share Posted March 27, 2013 Strange... put before setmaterial : self.buttonMaterial:SetBlendMode(1) change anything? I don't know really. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Rick Posted March 27, 2013 Author Share Posted March 27, 2013 no dice. Quote Link to comment Share on other sites More sharing options...
Andy Gilbert Posted March 27, 2013 Share Posted March 27, 2013 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 Quote 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 More sharing options...
Rick Posted March 27, 2013 Author Share Posted March 27, 2013 So this is working on PC. On mobile the cube is just all white. No texture at all Quote Link to comment Share on other sites More sharing options...
ChrisV Posted March 29, 2013 Share Posted March 29, 2013 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. Quote My Artwork. 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 More sharing options...
Rick Posted March 29, 2013 Author Share Posted March 29, 2013 *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 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. Quote Link to comment Share on other sites More sharing options...
Rick Posted March 29, 2013 Author Share Posted March 29, 2013 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! Quote Link to comment Share on other sites More sharing options...
lukhns Posted April 8, 2013 Share Posted April 8, 2013 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. Quote Link to comment Share on other sites More sharing options...
shadmar Posted April 8, 2013 Share Posted April 8, 2013 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; 1 Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
lukhns Posted April 9, 2013 Share Posted April 9, 2013 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.