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

Create a LightMap with raytracing

7 posts in this topic

hi,
I want to create a light map render using ray tracing for learning purpose.
I already builded the raytracer part, but i dont know how to generate the lightmap from that.
Today, i just throw the rays from my camera, calculate the intersection, shading, throw extra rays ....
But how do i use this to generate the lightmap ?
Do i need throw rays from each texel of my model's texture ? (how many rays should i throw ??!!) Is this the right way ?
And, to "throw rays from each texel of my model's texture", do i need to rasterize my triangles, get the generated position, them throw the rays ?

Thanks !! Edited by tpastor
0

Share this post


Link to post
Share on other sites
First of all you *need* to create texture coordinates for your lightmap (unless you already have them). For more information on how to unwrap your environment to lightmap read for example here - [url="http://www.blackpawn.com/texts/lightmaps/"]http://www.blackpawn.com/texts/lightmaps/[/url]

Now for each pixel in the lightmap, there exists "microfacet" in your scene, and you compute light for that microfacet using your ray tracer.
0

Share this post


Link to post
Share on other sites
In resume:
i have model that already have UV mapping.
I need to read the texels of my "empty" lightmap, find the model position associate with it and then use the raytracing in this position.
Do this for all my texels and thats it ??!!

Thanks !
0

Share this post


Link to post
Share on other sites
[quote name='Vilem Otte' timestamp='1352858088' post='5000747']
First of all you *need* to create texture coordinates for your lightmap (unless you already have them). For more information on how to unwrap your environment to lightmap read for example here - [url="http://www.blackpawn.com/texts/lightmaps/"]http://www.blackpawn...exts/lightmaps/[/url]

Now for each pixel in the lightmap, there exists "microfacet" in your scene, and you compute light for that microfacet using your ray tracer.
[/quote]

Assumming that your whole world is made out of quads...
Is there any method for packing [b]triangle[/b] world in to lightmap? Maybe I should just find every 2 triangles that has similar normal, and then assume those two triangles are one quad?
0

Share this post


Link to post
Share on other sites
[quote name='tpastor' timestamp='1352858660' post='5000751']
I need to read the texels of my "empty" lightmap, find the model position associate with it and then use the raytracing in this position.
Do this for all my texels and thats it ??!!
[/quote]

You actually need the position and normal, since you need to trace rays through the hemisphere surrounding the normal to calculate the total irradiance incident on the texel. Also in practice you'll find that it's actually not so simple to determine the position and normal for any given texel. To do it you need to figure out which triangle that the texel is mapped to, figure out the barycentric coordinates of the texel relative to the triangle, and then use those barycentric coordinates to intepolate the position and normal from the vertices. To make things even more complicated you'll often have multiple triangles overlapping a single texel, which means you have to be able to either consistently choose which triangle to use or you have to blend between the results from both triangles. One common way to do this is to rasterize the geometry in UV space. This lets you perform the interpolation as a normal part of the rasterization process, and you can also use standard rasterization techniques to choose which triangle to use or to even analytically compute the triangle coverage. You can even rasterize on the GPU if you want, although you'll probably want to use more than one sample per pixel since GPU's don't use conservative rasterizers.
2

Share this post


Link to post
Share on other sites
hi,
thanks for the answers (specially MJP), they helped me to make some real progress (i finally got something working !!!)
But now that i am implementing some stuffs ... some new doubts are raising... (iam too much "ad hoc", i want to know if what iam doing is the right way to do !)
Instead of making some more questions here, i would love if someone point me a good book or a project that does the simple thing i want to do (a light baker with raytracing -- not the illumination calculation part ...)

Thanks !
0

Share this post


Link to post
Share on other sites
I don't know of any projects that you could download. You could definitely take a look through some of the material in [url="http://realtimerendering.com/Principles_of_Digital_Image_Synthesis_v1.0.1.pdf"]Principles of Digital Image Synthesis[/url], as there is definitely some relevant sections in there.
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