Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am trying to write an ice shader in Unity that looks good and at least semi-realistic.

If the following shot (found on Google) was CG, what would its shader include? (the foreground cave). I might be wrong but it looks like it even has a different lighting model than the default diffuse.

enter image description here

share|improve this question
    
Here's a tutorial for DirectX 11 using HLSL and C++. Maybe you can glean the principles. Also, where did you see that the image was CG? It's reported as real. –  Byte56 Mar 26 '12 at 23:50
    
I didn't say it was. I said "if" it was. and Thanks! I'll check it out –  Dan the Man Mar 26 '12 at 23:58
9  
That phenomenon is called subsurface scattering. It's caused because light penetrates the surface of the material and is scattered through the medium of the material itself. It's why, for example, human ears look red when backlit. Here is a blog post explaining someone's attempt to recreate an ice effect with it. –  K.G. Mar 27 '12 at 0:16
    
Ah, sorry I missed the "if". –  Byte56 Mar 27 '12 at 0:20
    
@Byte56, No problem –  Dan the Man Mar 27 '12 at 0:50

2 Answers 2

up vote 46 down vote accepted

Ice is translucent so I believe the single most important thing you have to simulate in your shader to get realistic results would be subsurface scattering or SSS for short. SSS basically describes how rays of light penetrate the surface of translucent objects and scatter underneath it, being reflected multiple times in an irregular fashion, before finally exiting through a different location.

Here's a picture that I think demonstrates the effect nicely:

enter image description here

From the picture in your question we can also see that ice is quite reflective, so you'll probably also want to combine it with some sort of environment mapping for reflections, and also tone up the specularity in order to reinforce the highlights.

You can also try other things such as adding a bit of refraction, overlaying some sort of noise texture to add a bit of variation, or even some sort of bump mapping or displacement mapping for very small and subtle details.

Resources

Some other resources that I found while writing the answer:

share|improve this answer
    
You might also want to look into Ambient Occlusion (en.wikipedia.org/wiki/Ambient_occlusion) to simulate the darkening in the crags for that is usually pretty hard to get right using just shadows. –  Koarl Mar 28 '12 at 7:10
    
Awesome. thanks. –  Dan the Man Mar 29 '12 at 17:01

One of my students did this a few years ago (using renderman ) but lots of background in the thesis http://nccastaff.bournemouth.ac.uk/jmacey/MastersProjects/MSc09/Salas/index.html

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.