abs 2 Posted March 24, 2012 Hey guys, I'm not too used to RVMATs yet, but I followed some tutorials found around the interwebs and made a glass material. However, it looks a little foggy to me. The thing is, I'm not sure if this is normal. Can anyone tell me if I'm doing it right? It's supposed to be the parts around the coils on the rifle. Abs Share this post Link to post Share on other sites
max power 21 Posted March 24, 2012 (edited) Much of glass's look is about what it's reflecting and how it is reflecting it. It looks like you don't have a env map happening, in which case I think the glass is just reflecting white in all directions. The specular colour for glass I think should be between 1,1,1,0 and 3,3,3,0... if that ends up looking too fancy you can reduce it. The specular power should be between 100 and 1000. This supershader rvmat should give you a good basis to start your glass: ambient[]={1,1,1,1}; diffuse[]={1,1,1,1}; forcedDiffuse[]={0,0,0,1}; emmisive[]={0,0,0,1}; specular[]={1,1,1,0}; specularPower=1000; PixelShaderID="Super"; VertexShaderID="Super"; class Stage1 { texture="#(argb,8,8,3)color(0.5,0.5,1,1,NOHQ)"; uvSource="tex"; class uvTransform { aside[]={1,0,0}; up[]={0,1,0}; dir[]={0,0,0}; pos[]={0,0,0}; }; }; class Stage2 { texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)"; uvSource="tex"; class uvTransform { aside[]={8,0,0}; up[]={0,8,0}; dir[]={0,0,0}; pos[]={0,0,0}; }; }; class Stage3 { texture="#(argb,8,8,3)color(0,0,0,0,MC)"; uvSource="tex"; class uvTransform { aside[]={1,0,0}; up[]={0,1,0}; dir[]={0,0,0}; pos[]={0,0,0}; }; }; class Stage4 { texture="#(argb,8,8,3)color(1,1,1,1,AS)"; uvSource="tex"; class uvTransform { aside[]={1,0,0}; up[]={0,1,0}; dir[]={0,0,0}; pos[]={0,0,0}; }; }; class Stage5 { texture="#(argb,8,8,3)color(0,1,1,1,SMDI)"; //this 'smdi map' is white in the green and blue channels, meaning it's as shiny as it can be and as 'slick' as it can be on all pixels. uvSource="tex"; class uvTransform { aside[]={1,0,0}; up[]={0,1,0}; dir[]={0,0,0}; pos[]={0,0,0}; }; }; class Stage6 { texture="#(ai,64,64,1)fresnelGlass(2.1)"; uvSource="none"; }; class Stage7 { texture="ca\data\env_land_co.paa"; uvSource="none"; }; Ambient and diffuse seem to do different things, but I haven't really played with it much. I think ambient has more to do with the strength of the reflection of the env map. Specular colour and power also control how the env map looks. Specular colour seems to have a hand in controlling the colour and intensity of the env map, and specular power controls the degree to which it is sharp (or blurry). Edited March 24, 2012 by Max Power Share this post Link to post Share on other sites
abs 2 Posted March 24, 2012 Thanks Max! Your RVMAT was just the perfect amount of fancy, IMHO. Your post was also really informative, and very educational. Thanks again. :) Abs Share this post Link to post Share on other sites
max power 21 Posted March 24, 2012 (edited) I find that it helps sometimes to have an inner surface to the glass as well. You can take those glass polies, push them inward a wee bit using the 'move by normals' tool or perhaps scaling them individually in the y,z direction, and then flip their normals. In this case, you have the coils or what not in there so it may not be necessary. If you find the glass tubes look a little odd in some way, like there is something missing, it may be the inner surface. If course, the inner surface on these things would be reflecting the coils, and not so much the outside... I was experimenting a bit with glass and fluids when I was taking a look at some of CWR2's props. The glass here is way too thick in all cases but it helps you see how the inner surface is contributing: Edited March 24, 2012 by Max Power Share this post Link to post Share on other sites
abs 2 Posted March 27, 2012 Shoot...I didn't see your additional reply until now, Max. The inner surface on your bottles looks great! For my model, I wonder if just making the faces 2 sided wouldn't work just as well. I do have a question about your bottles, there, though...how did you make it so that the labels aren't as reflective as the glass itself? Thanks, mate. Abs Share this post Link to post Share on other sites
Fox '09 14 Posted March 27, 2012 I imagine the logos are separate meshes or just assigned a different material for the faces it occupies. If there is a better way I'd like to know it, I've been doing glass myself recently. Share this post Link to post Share on other sites
[frl]myke 15 Posted March 28, 2012 Can be done through the specular map (smdi texture) by painting the labels position black/dark grey. Share this post Link to post Share on other sites
max power 21 Posted March 28, 2012 (edited) Shoot...I didn't see your additional reply until now, Max.The inner surface on your bottles looks great! For my model, I wonder if just making the faces 2 sided wouldn't work just as well. I do have a question about your bottles, there, though...how did you make it so that the labels aren't as reflective as the glass itself? Thanks, mate. Abs I didn't make these bottles, all I did was fool around with the mesh to try to make it appear less two dimensional after I saw one on the table of one of our deployed MHQ models. I added the interior surface and the fluids. In this case, the labels are a separate mesh with no RVMAT. Edited March 28, 2012 by Max Power Share this post Link to post Share on other sites