• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
dpadam450

Car Shader

3 posts in this topic

I'm working on a car model right now and when I finish I want to get a good shader applied to it. I'm trying to get my head around it.
 

http://www.fotos.org/galeria/data/504/2007-Ford-Mustang-GT-fvl.jpg

 

 

What I can't wrap my head around is: It is not just a multiply (modulate) Because:
CubeMap*Black = Black.

So there are parts that reflect 90-100 percent color reflection (Green tree reflection from a black paint, sky, clouds). But yet it is not a 90-100 percent reflection everywhere because you can see there is black when the reflection would not be black. Same thing if the paint is red.

It appears as if surface normals pointing towards your eye appear to reflect less of a cubemap

 

 

 

http://img2.netcarshow.com/Ford-Mustang_GT_2000_800x600_wallpaper_03.jpg

Now in this image above, You see the horizon/tree line reflection in the bumper have no real color. There are some trees reflected in the back by the gas tank area and again they reflect no color.

0

Share this post


Link to post
Share on other sites

I guess the view angle is fresnel. But It still doesn't make sense that those reflections are not showing up green in the second image.

0

Share this post


Link to post
Share on other sites

Yes, the strength of the reflection is dependent on Fresnel (which depends on the IOR/spec-mask of the material), and the reflections are added over all the other shading, not multiplied.

 

The trees do reflect green, it's just that the reflection there is quite weak compared the the amount of red light that's also coming for those areas, so the subtle green appears washed out in the camera. Keep in mind that the objects in that image are probably objectively 1000 times darker than the sky, when it comes to measuring them as light sources, so in the reflection, you can only really make out the sky and silhouettes of objects blocking the sky.

 

Car paint is actually very complex to simulate realistically. The most basic version is a white (colourless) specular reflection added over a Lambert diffuse surface -- which represents the wax/clear-coat, and the underlying surface.

In a more involved shader, you've got several different specular reflections -- the clear-coat, the surface of the paint, and microscopic metal flakes (in metallic paints). The first one will be white, but the other specular reflections may be coloured.

-------
clear coat
--------
paint
--------
+  x  \  /  -  x flecks of coloured metals suspended in the paint
--------
more paint
--------
opaque primer
--------
underlying metal surface (not visible)
Edited by Hodgman
0

Share this post


Link to post
Share on other sites

If you want to start to understand the basics components that add up to the overall look of that car, then you'll need a crash course in reflectance. Reflectance is determining what light reflects off a surface in a particular direction based on the light hitting the surface as well as the properties of the surface itself. I'd recommend reading through this course from SIGGRAPH 2006, or the intro to this course from SIGGRAPH 2010. Real-Time Rendering 3rd edition also covers a lot of the same material, if you have access to that.
 

For perfectly smooth/mirror surfaces that produce non-blurry reflections (such as the top layer of car paint) the reflectance is mostly governed by Fresnel's laws. You have some light that reflects off in the perfect reflection direction, and some that refracts into the surface. The amount reflected depends on the properties of the material as well as the incident angle of the reflection, but in general the reflection amount will increase as the angle of incidence increases. This is why the reflection on the car is stronger at glancing angles, where the reflected light is nearly perpendicular to the surface normal.

The rest of the look of car paint comes from the light that refracts into the surface and then comes out again. Some of it might be scattered inside of homogeneous media, partially absorbed by pigments, and then leave the surface in many random directions. This light is usually modeled by simple diffuse terms, which aren't view-dependent. Some of it may also hit the microscopic metal flags that Hodgman referred to, which produce "blurry" specular reflections due to the random orientation of the flakes in the material. This sort of phenomena is typically approximated with microfacet BRDF's, which model a surface being made up of tiny fresnel reflectors whose normal directions are distributed about the overall surface normal according to a probability distribution function

So like Hodgman said...it's a bit complicated. I would suggest getting the mirror reflections with fresnel working (use schlick's approximation) combined with some basic diffuse, and at that point it will start to look like a car.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0