Rob Posted February 22, 2013 Posted February 22, 2013 Hi im working on something with a glass surface and I was wondering if it is possible to have a softer alpha, at the moment I only achieved to have an alpha value of 1 and 0 so I can either see through it or not at all but I like to create some dirt on the windows so I need more than just 2 values How do I do this in Unigine, and what are the settings for the material as I've been looking through the samples and demos but couldnt really find anything Anyone know how to do this or have a tutorial perhaps?
nat.harrold Posted February 22, 2013 Posted February 22, 2013 Hi Rob, Try setting your alpha to mid grey, then output to dxt5. When in unigine set blending modes to src alpha, and one minus src alpha. (no alpha test). This will give you control of the alpha slider in the colour setting on the parameters panel and give you more control. Hope this helps.
Rob Posted February 22, 2013 Author Posted February 22, 2013 Hi Rob, Try setting your alpha to mid grey, then output to dxt5. When in unigine set blending modes to src alpha, and one minus src alpha. (no alpha test). This will give you control of the alpha slider in the colour setting on the parameters panel and give you more control. Hope this helps. Great will give this a shot! Thank you!
nat.harrold Posted February 22, 2013 Posted February 22, 2013 Here is a more detailed explanation / tutorial (with pictures - for artists - too much code gets pasted around here :)) This will create a nice simple reflective dirty transparent glass with no refraction or shadow casting ability. 1. create textures for diffuse and specular both with interpolated alpha channels. (eg dxt3 or dxt5) - for speed, follow the attached image (explanation_glass_dirty.jpg) - diffuse is inverted and desaturated for specular texture - copy your specular texture into the alpha channel of the diffuse texture - copy your specular texture into the alpha channel of the specular texture (the alpha channel of the spec map interpolates / controls reflection amounts) - save .dds with interpolated alpha 2. Inherit material from a reflective one. - set blending modes: Src: src alpha Dest: one minus src alpha - do not use alpha test - set textures, save and apply. - tweak values. (high glossiness value +180) - check 2-sided if you need explanation_glass_dirty.jpg explains more about which parts of the textures and channels create different results.
Rob Posted March 27, 2013 Author Posted March 27, 2013 Hi Rob, Try setting your alpha to mid grey, then output to dxt5. When in unigine set blending modes to src alpha, and one minus src alpha. (no alpha test). This will give you control of the alpha slider in the colour setting on the parameters panel and give you more control. Hope this helps. For some reason my entire model will become transparent while only parts need to be transparent...anyone know how to fix this? I added a screnshot of the issue, seems to be some sort of z sorting issue but I dont have a clue of how to fix it I already tried to change the Order values but this didnt help
Guest shane.ploenges Posted March 28, 2013 Posted March 28, 2013 Nice tutorial Nat, i think there should be a Tutorials section added to the forums - it may encourage others to take the time to share things also.
nat.harrold Posted March 28, 2013 Posted March 28, 2013 Hi Rob, I can't be certain without the the material, texture and geometry in front of me to pick at. Things to try: Is depth mask checked? (also not sure about the hexagonal anomaly in centre, maybe fresnel related?) I did mean to edit the above post you quoted; *you should use full white alpha, (instead of mid grey), if you intend to use the alpha slider parameter. If you want parts of the material to be opaque and parts to be transparent you need to control that not from the slider, but from the alpha channel values in your texture. (As soon as you use the alpha value slider in the diffuse_colour colour, then even the white alpha'd parts will become transparent dependant on the slider position, when using src alpha and one minus src alpha. Hope this helps.
Rob Posted March 28, 2013 Author Posted March 28, 2013 Hi Rob, I can't be certain without the the material, texture and geometry in front of me to pick at. Things to try: Is depth mask checked? (also not sure about the hexagonal anomaly in centre, maybe fresnel related?) I did mean to edit the above post you quoted; *you should use full white alpha, (instead of mid grey), if you intend to use the alpha slider parameter. If you want parts of the material to be opaque and parts to be transparent you need to control that not from the slider, but from the alpha channel values in your texture. (As soon as you use the alpha value slider in the diffuse_colour colour, then even the white alpha'd parts will become transparent dependant on the slider position, when using src alpha and one minus src alpha. Hope this helps. Depth map is checked, it seem all of the non transparent shapes in the scene are somehow seen through the objecy, im using a normal mesh_base material and the mesh is divided in the following parts: Building, Plants, Airco Units, Neon signs, Sun protection thingies and tables/chairs So what you are saying is I need 100% black and 100% white when I use src alpha and dest one minus src alpha? I dont really need the sldier but for example I want the background of the plants to be 100% transparent and the neon lights only about 50% transparent, same goes for the glass panes etc If its usefull I could pack up the material and mesh and attach it here Thanks for the help so far
manguste Posted April 4, 2013 Posted April 4, 2013 So what you are saying is I need 100% black and 100% white when I use src alpha and dest one minus src alpha? No magic here. 100% black in the texture = opaque, 100% white = transparent, so for 50% transparency it should be 50% alpha. And yes, if you tweak the Diffuse color->Alpha slider, all values are affected. So do not use it, bake necessary alpha values into a texture instead.
manguste Posted April 5, 2013 Posted April 5, 2013 Here is a how-to from our artists how to create a nice-looking, refractive glass using TWO surfaces and materials: How to Create Glass Nat, I've added your great how-to there as well. Hope you do not mind :)
Recommended Posts