• 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
lipsryme

Gaussian specular in UnrealEngine4

9 posts in this topic

So I was reading in the unreal engine 4 siggraph paper about their usage of an empirical model for this.
If you haven't seen it it's on page 30 or so: [url="http://www.unrealengine.com/files/misc/The_Technology_Behind_the_Elemental_Demo_16x9_%282%29.pdf"]http://www.unrealeng...mo_16x9_(2).pdf[/url]

Now the only thing I was wondering is this model as it is stated in the paper, is not normalized as it seems.
And as far as the code is concerned they only describe this factor for their area light sources.
Does anyone have an idea of what the correct normalization factor for this specific model would be for a regular punctual light source ? Edited by lipsryme
0

Share this post


Link to post
Share on other sites
Unfortunately I couldn't solve it analytically (I doubt it's even solvable this way), but I came up with a simple aproximation: 0.17287429 + 0.01388682 * n. Where n is Blinn-Phong specular power. It's quite accurate for specular powers above 16. If you are interested I have posted some plots on my blog: [url="http://kriscg.blogspot.com/2012/10/unreal-engine-4-gaussian-specular.html"]http://kriscg.blogsp...n-specular.html[/url] .
2

Share this post


Link to post
Share on other sites
[quote name='KriScg' timestamp='1349556635' post='4987502']
Unfortunately I couldn't solve it analytically (I doubt it's even solvable this way), but I came up with a simple aproximation: 0.17287429 + 0.01388682 * n. Where n is Blinn-Phong specular power. It's quite accurate for specular powers above 16. If you are interested I have posted some plots on my blog: [url="http://kriscg.blogspot.com/2012/10/unreal-engine-4-gaussian-specular.html"]http://kriscg.blogsp...n-specular.html[/url] .
[/quote]

splendid! :)
0

Share this post


Link to post
Share on other sites
I've implemented it for Disney's BRDF Explorer and evaluated how closely it fits the Mitsubishi MERL BRDF database. I found out, that its shape is pretty unrealistic. Also, KriScg's approximation was off by about the factor 2.

Here's the better approximation of the NDF:
[img]http://cryze.us.to/d_mittring.png[/img]

Also here's a plot of its shape compared to the more physically correct GGX distribution function:

[img]http://cryze.us.to/plot_mittring_ggx.png[/img]

It's actually even slower than GGX, so why would anyone want to use it anyway [img]http://public.gamedev.net//public/style_emoticons/default/huh.png[/img] Edited by CryZe
0

Share this post


Link to post
Share on other sites
Yeah I've also been a bit confused as to why they're going with that BRDF. GGX is really nice, and I find it works well for a lot of materials. Edited by MJP
0

Share this post


Link to post
Share on other sites
[quote name='CryZe' timestamp='1350141452' post='4989792']KriScg's approximation was off by about the factor 2.
[/quote]

I think it's because you are using wrong treshold 0.004 (it was 0.04 in the presentation).
0

Share this post


Link to post
Share on other sites
[quote name='MJP' timestamp='1350161918' post='4989886']
Yeah I've also been a bit confused as to why they're going with that BRDF. GGX is really nice, and I find it works well for a lot of materials.
[/quote]

We're talking about the same Epic/Unreal engine, right? I can probably count on one hand the number of 'yes, *this* is a smart renderer design decision' moments in recent memory :(

I mean, look at the entire HDR pipeline in UE3.
0

Share this post


Link to post
Share on other sites
[quote name='KriScg' timestamp='1350245660' post='4990133']
[quote name='CryZe' timestamp='1350141452' post='4989792']KriScg's approximation was off by about the factor 2.
[/quote]

I think it's because you are using wrong treshold 0.004 (it was 0.04 in the presentation).
[/quote]
Oh wow, I didn't even realize that. I might fix my post, after I've tried the correct version.

Edit: Overall, nothing really much changed, except the fact, that the approximation is still off, but not by a factor of 2. The problem is, that you want the integral to evaluate to 1 and not to "<= 1". Edited by CryZe
0

Share this post


Link to post
Share on other sites
[quote name='CryZe' timestamp='1350403199' post='4990770']
The problem is, that you want the integral to evaluate to 1 and not to "<= 1".
[/quote]

I did solve it for integral = 1. I just wrote it as <= 1. Thanks for noticing.

I wrote a brdf for BRDF explorer with "Mittring" specular.

[source lang="plain"]analytic

::begin parameters
float n 1 1000 100
bool normalized 1
::end parameters

::begin shader

vec3 BRDF( vec3 L, vec3 V, vec3 N, vec3 X, vec3 Y )
{
vec3 H = normalize( L + V );
float Dot = clamp( dot( N, H ), 0, 1 );
float Threshold = 0.04;
float CosAngle = pow( Threshold, 1 / n );
float NormAngle = ( Dot - 1 ) / ( CosAngle - 1 );
float D = exp( -NormAngle * NormAngle );

if (normalized)
{
D *= 0.17287429 + 0.01388682 * n;
//D *= 0.34574858 + 0.02777364 * n;
}

return vec3(D);
}

::end shader[/source]

Now when you use mine aprox, then max albedo in BRDF explorer correctly comes up as 1, but when using yours it's 2. This means, that in yours aprox sometimes outgoing energy is two times greater than incoming. I believe it's because you did integrate over full sphere, instead of just upper hemisphere. Edited by Krzysztof Narkowicz
0

Share this post


Link to post
Share on other sites
[quote name='InvalidPointer' timestamp='1350400338' post='4990749']

We're talking about the same Epic/Unreal engine, right? I can probably count on one hand the number of 'yes, *this* is a smart renderer design decision' moments in recent memory [img]http://public.gamedev.net//public/style_emoticons/default/sad.png[/img]

[/quote]

I don't think that's particularly fair. They have plenty of good tech, and lots of people have made really good games with it.

Anyway I wasn't implying that they made the wrong decision with their choice, just that I didn't understand the motivation behind it.
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