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

Radiosity Aliasing Issue

9 posts in this topic

Hi ,



For the screenshot below , I made 17 bounces for the geometry which has 22k polygons

(In my renderer , each polygon is a patch )


Except than using smaller and more polygons , what would you suggest to get a smooth output ?


I`ve read about interpolate shading but I already treat each polygon as a patch. Perhaps an object space anti aliasing

in which I will be using average of 4x4 or more neighbours` total color , as color value for each patch ?


[img]http://img843.imageshack.us/img843/6041/radiosity.jpg[/img]

1

Share this post


Link to post
Share on other sites
How can I do that ?



Besides , if I dont write to texture , how can I do the interpolation ?
0

Share this post


Link to post
Share on other sites
[quote name='akhin' timestamp='1314215366' post='4853351']
How can I do that ?
[/quote]
How [i]exactly[/i] depends on the API, but more-or-less, each "patch" for radiosity purposes would just be a texel.

[quote name='akhin' timestamp='1314215366' post='4853351']
Besides , if I dont write to texture , how can I do the interpolation ?
[/quote]

You could also think in terms of vertices instead of polygons, and let the API interpolate the vertex colors across the triangles for you. Not that there's any reason to do this instead of texturing.
0

Share this post


Link to post
Share on other sites
[quote name='Emergent' timestamp='1314239654' post='4853494']
[quote name='akhin' timestamp='1314215366' post='4853351']
How can I do that ?
[/quote]
How [i]exactly[/i] depends on the API, but more-or-less, each "patch" for radiosity purposes would just be a texel.

You could also think in terms of vertices instead of polygons, and let the API interpolate the vertex colors across the triangles for you. Not that there's any reason to do this instead of texturing.
[/quote]


Ok , I can easily create textures per surface in D3D9. But after that I guess what I need to do is

setting sampler state with bilinear filtering ( minification+magnification ) and linear or anisotropic filtering ?
0

Share this post


Link to post
Share on other sites
[quote name='akhin' timestamp='1314330430' post='4853917']
Am I on the right track ?
[/quote]
If I understand Emergent right, his last suggestion was to calculate and store radiosity per vertex. When you render these vertices later, the color will automatically be interpolated between the vertices by D3D. If your scene is adequately tessellated (which seems to be the case) the results can be quite decent I believe.

Or were you asking about light maps specifically?

0

Share this post


Link to post
Share on other sites
vertex colors have the disadvantages that you'll draw a patch using two triangles and the interpolation won't look properly, you will have similar issues like with [url=http://en.wikipedia.org/wiki/Gouraud_shading]gouraud shading[/url]. it depends on what you do and what limitations you have, on mobile platforms that might be quite ok, on consoles/pc you might expect more.




create a texture in memory first (basically a 2d array of colors)

you need to create a UV set for that texture (in a simple case you can just planar project your surface).

based on the UVs draw the color of the patch, for each patch, into the texture.

not urgently needed, but it can increase the quality if you have a dilation step that fills the yet unfilled pixels by the neighbour colors. (you can repeat this step several times).

some people additionally blur the texture, that can hide artifacts if you don't use a water tight patch (-> if partially occluded patches exist).

also not urgently needed, but it can improve the quality if you create the lightmap in a higher resolution and as last step scale it down to the desired resolution.

as last step, create a device texture and copy your local texture.




some old school tutorial that might help.

http://www.flipcode.com/archives/Light_Mapping_Theory_and_Implementation.shtml




you make me want to work on my radiosity calculator again http://twitpic.com/4khy8e :)



















0

Share this post


Link to post
Share on other sites
Other than increasing tessellation, would storing at vertex level improve the problem much?

I'm reminded for spherical harmonics lighting, you typically calculate lighting at the vertex level and let the graphics card interpolate across the triangle. Unless your lighting/shadow variations on your surfaces changes very slowly, the outlines of typical shadows become zigzaggy.

The reason is if a shadow edge cuts through the middle of a triangle, vertex interpolation can't reproduce this edge. Might there be some work addressing this?

I'm really interested in seeing some demos showcasing how good can either radiosity or spherical harmonics can achieve, and the amount of tessellation required.
0

Share this post


Link to post
Share on other sites
On a basic level, there's really not a ton of difference between storing your lighting in your vertices or in a texture. In both cases you have a sparse set of sample points covering a large set of surfaces, and you interpolate between those sample points to help alleviate the aliasing artifacts. However you need a high sample point resolution if you want to capture high-frequency lighting changes, which typically occur in shadows from direct lighting. The advantages of using textures for this are...
[list=1][*]Your sample points are regularly spaced on a grid, while with vertices located based on the topology of the mesh[*]You can increase the sample resolution for certain surfaces without having to add more vertices, which means adding more position/normal/tangent/whatever data as well as increasing the number of triangles you need to render (it also means you use smaller triangles, which are less efficient)[*]You can compress textures[*]You can mipmap textures[*]Typically you can stream textures more easily than vertex data, or you can also use them in conjunction with virtual textures[/list]Of course it's typically easier to get up and running with per-vertex data since you don't need to parametrize all of the meshes in your scene, or deal with lightmap atlasing/packing.

Also, the resolution needed for your lighting samples depends on what lighting you're calculating. For shadows or small-scale AO you'll need quite a bit of resolution for it to look good...even with lightmaps you typically end up with pretty blurry shadows that don't match your real-time shadows. However if you don't store direct lighting and only store indirect lighting or indirect + sky lighting, you can get pretty good results once you composite in some real-time lighting with shadows. Naughty Dog did this for a lot of their outdoor scenes in Uncharted 2, with lighting stored per-vertex. I also did this with [url="http://mynameismjp.wordpress.com/2011/01/31/radiosity-dx11-style/"]my radiosity sample[/url]. If you look at the pictures you can see the indirect + sky lighting looks pretty messy on its own, but combined with the sun lighting + shadows it ends up looking pretty nice. Using a basis like H-basis also helps a lot, since you still get some high-frequency variation from the normal maps. One of the Uncharted 2 presentations also has some pictures like that and they have similar results.

EDIT: I forgot to mention this recent publication that attempts to address issues with interpolating vertex-baked samples: [url="http://www.ppsloan.org/publications/vb-egsr11.pdf"]http://www.ppsloan.org/publications/vb-egsr11.pdf[/url]
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