Rick Posted August 6, 2011 Share Posted August 6, 2011 I've never actually been able to get semi-transparent models to work in LE. What exactly is required to get a model to be semi-transparent? 1) Does anything in the material or texture need to be different from a model that I would draw in the main world? 2) How do you set the level of transparency to this model? 3) Is the level of transparency specific to each model or the entire transparent world? What I'm currently doing is the following but the model has 0 transparency. It looks normal. function object:LoadTransparentModel() -- Change to transparent layer SetWorld(fw.transparency.world) -- Load assassin model that will be transparent object.transparentModel = LoadModel("abstract::fantasy_bad_assassin.gmf") object.transparentModel:SetPosition(object.model:GetPosition(1), 1) object.model:Hide() EntityColor(object.transparentModel, Vec4(1, 1, 1, .3)) -- Go back into main layer SetWorld(fw.main.world) end Quote Link to comment Share on other sites More sharing options...
Flexman Posted August 6, 2011 Share Posted August 6, 2011 MESH.FRAG takes the alpha of the model, so you've set it to 0.3 and later if you have LW_DIFFUSE defined it multiplies diffuse with the texture values. So possibly it's worth checking the models alpha channel and if it's pulling out a ZERO it's probably that. Materials are well worth checking here as your function (above) looks fine to me. Quote 6600 2.4G / GTX 460 280.26 / 4GB Windows 7 Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT Tricubic Studios Ltd. ~ Combat Helo Link to comment Share on other sites More sharing options...
Rick Posted August 6, 2011 Author Share Posted August 6, 2011 So you can't use the same material then as what you would use in the main world for the model huh? That sucks. What should the material look like for this to work? Quote Link to comment Share on other sites More sharing options...
Canardia Posted August 6, 2011 Share Posted August 6, 2011 texture0="abstract::semitransparent.dds" blend=alpha Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Rick Posted August 7, 2011 Author Share Posted August 7, 2011 So my actual texture has to be semi-transparent as well? That can't be controlled in code via some alpha value to EntityColor() or anything? Quote Link to comment Share on other sites More sharing options...
Flexman Posted August 7, 2011 Share Posted August 7, 2011 Just add blend=alpha as Metatron posted and try it. If still no joy add an alpha layer to the texture. It shouldn't be difficult to do. Your setting of the alpha in code should work as you intend (it's multiplying that value with another). You should be able to control fade in and out by adjusting the alpha in SetColor() once you get the texture and blend sorted out. Quote 6600 2.4G / GTX 460 280.26 / 4GB Windows 7 Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT Tricubic Studios Ltd. ~ Combat Helo Link to comment Share on other sites More sharing options...
Rick Posted August 7, 2011 Author Share Posted August 7, 2011 Can't seem to get this working. Here is the mat file I'm using with the above code. The result looks just normal. The model doesn't look transparent at all. texture0="Orc_D2.dds" texture1="Orc_N2.dds" alpha=blend shader="abstract::mesh_diffuse_bumpmap_skin.vert","abstract::mesh_diffuse_bumpmap_specular.frag" shadowshader="abstract::mesh_shadow_skin.vert" If you can add an alpha layer to the texture so it's just solid and add blend=alpha I'm saving the texture as DXT5(Alpha) so guessing it has that Alpha layer. Has anyone done something like this before with the framework and if so if they could share all the details about how they got it to work that would help. Quote Link to comment Share on other sites More sharing options...
macklebee Posted August 7, 2011 Share Posted August 7, 2011 texture0="Orc_D2.dds" texture1="Orc_N2.dds" alpha=blend shader="abstract::mesh_diffuse_bumpmap_skin.vert","abstract::mesh_diffuse_bumpmap_specular.frag" shadowshader="abstract::mesh_shadow_skin.vert" take another look at that... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Rick Posted August 7, 2011 Author Share Posted August 7, 2011 Man, I'm pretty sure I have a mild case of dyslexia It seems to work 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.