Jump to content

Photo
- - - - -

Is this how glass is supposed to look?


  • Please log in to reply
7 replies to this topic
Thread Starter
abs
abs

    Warrant Officer

  • Members
  • 2427 posts

Posted 24 March 2012 - 03:40 #1

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.

Posted Image

Abs
My Projects:
Posted Image
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!

Max Power
Max Power

    Mr. Angry Face

  • Members
  • 12828 posts

Posted 24 March 2012 - 04:00 #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:

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 by Max Power, 24 March 2012 - 04:04.

Posted Image
Posted Image
My inbox is fill and won't be emptied. If your PM is regarding requests to use my work, unfortunately I choose not to grant such permission. My work is for use with CWR2 only.

Thread Starter
abs
abs

    Warrant Officer

  • Members
  • 2427 posts

Posted 24 March 2012 - 14:27 #3

Thanks Max! Your RVMAT was just the perfect amount of fancy, IMHO. Your post was also really informative, and very educational. Thanks again. :)

Posted Image

Abs
My Projects:
Posted Image
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!

Max Power
Max Power

    Mr. Angry Face

  • Members
  • 12828 posts

Posted 24 March 2012 - 19:16 #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:

Posted Image

Edited by Max Power, 24 March 2012 - 19:29.

Posted Image
Posted Image
My inbox is fill and won't be emptied. If your PM is regarding requests to use my work, unfortunately I choose not to grant such permission. My work is for use with CWR2 only.

Thread Starter
abs
abs

    Warrant Officer

  • Members
  • 2427 posts

Posted 27 March 2012 - 19:39 #5

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
My Projects:
Posted Image
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!

Fox '09
Fox '09

    Chief Warrant Officer

  • Members
  • 3327 posts

Posted 27 March 2012 - 22:08 #6

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

-FRL-Myke
-FRL-Myke

    Moderator

  • 6571 posts

Posted 28 March 2012 - 06:12 #7

Can be done through the specular map (smdi texture) by painting the labels position black/dark grey.
Posted Image

Max Power
Max Power

    Mr. Angry Face

  • Members
  • 12828 posts

Posted 28 March 2012 - 12:41 #8

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 by Max Power, 28 March 2012 - 12:45.

Posted Image
Posted Image
My inbox is fill and won't be emptied. If your PM is regarding requests to use my work, unfortunately I choose not to grant such permission. My work is for use with CWR2 only.