Results 1 to 8 of 8

Thread: Is this how glass is supposed to look?

  1. #1
    Warrant Officer Abs's Avatar
    Join Date
    Jan 28 2007
    Location
    Sector 001
    Posts
    2,394

    Question Is this how glass is supposed to look?

    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
    My Projects:

    RHS Contributor | Former ONS Member | Former W'39 Member
    I will not be taking part in the contest, but I support it 100%! Great idea, BIS!

  2. #2
    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:

    Code:
    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).
    Last edited by Max Power; Mar 24 2012 at 03:04.


    Please use the CWR2 CBT to help us provide a better experience.

  3. #3
    Warrant Officer Abs's Avatar
    Join Date
    Jan 28 2007
    Location
    Sector 001
    Posts
    2,394
    Author of the Thread
    Thanks Max! Your RVMAT was just the perfect amount of fancy, IMHO. Your post was also really informative, and very educational. Thanks again.



    Abs

  4. #4
    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:

    Last edited by Max Power; Mar 24 2012 at 18:29.

  5. #5
    Warrant Officer Abs's Avatar
    Join Date
    Jan 28 2007
    Location
    Sector 001
    Posts
    2,394
    Author of the Thread
    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

  6. #6
    Chief Warrant Officer Fox '09's Avatar
    Join Date
    Jun 5 2009
    Location
    Florida
    Posts
    3,327
    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.
    "Simulations aren't about the destination, they are about the way there." - Metalcraze

  7. #7
    Moderator [FRL]Myke's Avatar
    Join Date
    May 27 2007
    Location
    Yay, Rank 34 of 47119 and catching up.
    Posts
    6,198
    Can be done through the specular map (smdi texture) by painting the labels position black/dark grey.
    99 little bugs in my code
    99 little bugs in my code
    take one down, patch it around
    127 little bugs in my code

  8. #8
    Quote Originally Posted by Abs View Post
    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.
    Last edited by Max Power; Mar 28 2012 at 12:45.

Similar Threads

  1. Preprocessor error? What is it supposed to be?
    By VonNexus in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 1
    Last Post: Feb 19 2012, 14:25
  2. arma2oaserver parameters, How am I supposed to set this up?
    By doonbugie in forum ARMA 2 & OA - Servers & Administration
    Replies: 2
    Last Post: May 20 2011, 17:07
  3. Arent patches supposed to fix?!!!
    By Meelobee in forum ARMA 2 & OA - TROUBLESHOOTING
    Replies: 1
    Last Post: Sep 16 2009, 20:26
  4. Replies: 6
    Last Post: Mar 31 2003, 07:14
  5. Isn't 1.42 supposed to fix this......??
    By OperationFPoint in forum GENERAL
    Replies: 3
    Last Post: Feb 14 2002, 21:12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •