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

opengl_beginner

Members
  • Content count

    10
  • Joined

  • Last visited

Community Reputation

106 Neutral

About opengl_beginner

  • Rank
    Member
  1. Hi there again! [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] I am dealing with spherical harmonics once again. The new problem is the following: [quote]I would like to compute the SH coefficients of HDR images and construct a sphere map of it.[/quote] I've started my looking at the official [url="http://graphics.stanford.edu/papers/envmap/prefilter.c"]project page[/url], which contains the function [font=courier new,courier,monospace]prefilter.c.[/font] The code structure is the following: [CODE] input(filename, width) ; prefilter(width) ; tomatrix() ; [/CODE] Unfortunately though, when I tried running the c-file on HDR images, I got an error (incompatible format). The accepted format is .float. I would like to change the [b]input(filename, width) [/b]function to accept the HDR format as well. The next idea I came up with was to use a library to read HDR images, namely, the [url="http://www.flipcode.com/archives/HDR_Image_Reader.shtml"]following[/url]. Unfortunately though, this one is written in C++. Thus, I am asking myself how to combine the two. Any ideas on how to get started would be greatly appreciated.
  2. Firstly, thanks all, for your remarks. Things are becoming much clearer now. I would like to say the following. 1) Although, I do not quite understand why a point light source is a Dirac Delta function in the frequency space. I know that the span of the spatial domain is inversely proportional to the span in the frequency domain, i.e. if a function is spread in (x, y, z) coordinates, it will be concentrated in the frequency domain. BUT - a point light source is concentrated in the spatial domain (it's just a line) and thus, I would expect it to be spread out in the frequency domain. Why is this not the case? 2) Perhaps I should explain what the motivation behind the problem is. Very often we come across images which contain dark spots. By adding a point light source to the current scene illumination, I wanted to make these spots lighter, i.e. 'more visible'. Since all of you are advising against using a point light source, do you see any other variant of how to address this problem? Thanks, opengl_beginner
  3. [quote name='Hodgman' timestamp='1353239477' post='5002009'] [quote name='opengl_beginner' timestamp='1353232912' post='5001996'] Well, as I mentioned, let's take the direction vector [0 0 1], with an infinite point light source. [/quote]Ah ok. The confusion was because an infinite/directional and a point/omni light are different things. The details for directional lights are contained in the [url="http://www.ppsloan.org/publications/StupidSH36.pdf"]Stupid SH Tricks[/url] paper in the "Analytic Models" section. [/quote] Hey Hodgman! Thanks a lot for the reference. I had seen the tutorial before, but never managed to notice the relevant chapter! [quote] Directional lights are trivial to compute, you simply evaluate the SH basis functions in the given direction and scale appropriately (see Normalization section.) Spherical Light sources can be efficiently evaluated using zonal harmonics. Below is a diagram showing an example scene, we want to compute the incident radiance, a spherical function, at the receiver point P. Given a spherical light source with center C, radius r, what is the radiance arriving at a point P d units away? The sin of the half-angle subtended by the light source is r/d, so you just need to compute a light source that subtends an appropriate part of the sphere. The ZH coefficients can be computed in closed form as a function of this angle: ? = integral ( integral (y_l, \theta, 0, 2Pi ) ,\theta, 0, a ) where a is the half-angle d subtended. See Appendix A3 ZH Coefficients for Spherical Light Source for the expressions through order 6. [/quote] I assume a = r/d, where d is infinite and thus a = 0. I've looked into the Appendix for L = 1, ...., 6: [quote] L=0: ?sqrt(?)(?1+cos(a)) L =1: 1/2 sqrt(3) sqrt(?) sin(a)2 L=2: ?1/2 * sqrt(5) * sqrt(?) * cos(a) (?1 + cos(a)) (cos(a) + 1) L=3 ?1/8 *sqrt(7)* sqrt(?) (?1 + cos(a)) (cos(a) + 1) (5 cos(a)^2 ? 1) L=4 ?3/8*sqrt(?)*cos(a) (?1 + cos(a)) (cos(a) + 1) (7 cos(a)2 ? 3) L=5 ? 1/16* sqrt(11)*sqrt(?)* (?1 + cos(a)) (cos(a) + 1) (21 cos(a)4 ? 14 cos(a)2 + 1) [/quote] So, clearly, all coefficients will be 0 due to the term (-1 + cos(a)), which is 0 for a = 0. Where is the flaw in my derivation?
  4. [quote name='ginkgo' timestamp='1353185215' post='5001840'] Short answer: You can't really. Representing a point-light requires an infinite number of coefficients. Long answer: You can approximate it using a circular shape. The paper "Algorithms for Spherical Harmonic-Lighting" By Ian G. Lisle and S.-L. Tracy Huang gives a method for calculating the coefficients for this directly.[/quote] Hey ginkgo! Well, yes - but isn't that exactly the idea behind spherical harmonics - approximating a function using a polynomial of a finite degree (e.g. degree 2 already gives an error rate less than 1%). I have found several methods for computing the coefficients, amongst others, the original project page for irradiance computation: [url="http://graphics.stanford.edu/papers/envmap/"]Link[/url], which provides the function prefilter.c to compute coefficients. But the input to this function is an environment map (an image), for which the lighting is computed. [quote name='Hodgman' timestamp='1353195036' post='5001876'] You'd also have to know the distance to the light. [/quote] Well, as I mentioned, let's take the direction vector [0 0 1], with an infinite point light source. Further suggestions?
  5. [quote name='ginkgo' timestamp='1353185215' post='5001840'] Short answer: You can't really. Representing a point-light requires an infinite number of coefficients. Long answer: You can approximate it using a circular shape. The paper "Algorithms for Spherical Harmonic-Lighting" By Ian G. Lisle and S.-L. Tracy Huang gives a method for calculating the coefficients for this directly.[/quote] Hey ginkgo! Well, yes - but isn't that exactly the idea behind spherical harmonics - approximating a function using a polynomial of a finite degree (e.g. degree 2 already gives an error rate less than 1%). I have found several methods for computing the coefficients, amongst others, the original project page for irradiance computation: [url="http://graphics.stanford.edu/papers/envmap/"]Link[/url], which provides the function prefilter.c to compute coefficients. But the input to this function is an environment map (an image), for which the lighting is computed. [quote name='Hodgman' timestamp='1353195036' post='5001876'] You'd also have to know the distance to the light. [/quote] Well, as I mentioned, let's take the direction vector [0 0 1], with an infinite point light source. Further suggestions?
  6. Hi guys! I have a new interesting question for us today: Given the direction to a point light source (e.g. [0 0 1]), how do we find the spherical harmonics representation of it? Let's assume the degree of approximation is 2, i.e. there are 9 coefficients for each color channel. Here's a link to an excellent tutorial on this topic: [url="http://www.cs.columbia.edu/~cs4162/slides/spherical-harmonic-lighting.pdf"]http://www.cs.columbia.edu/~cs4162/slides/spherical-harmonic-lighting.pdf[/url] Unfortunately though, it does not answer my question. Thanks and looking forward to your suggestions!
  7. Hi guys! [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] I'm working on a very simple problem right now. I would like to create a user interface of the following structure: 1) Drop-drop menu with options of multiple image names 2) Image panel, which displays the image selected in the menu Any ideas of how to get started? Thanks![img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
  8. Hi again! This project shows what I would like to do: [url="http://www.yasrt.org/shlighting/"]http://www.yasrt.org/shlighting/[/url] These are the steps I have been thinking of: 1) Compute SH coefficients for different light probes (e.g. Grace Cathedrale) 2) Generate a sphere, which represents the SH illumination model 3) Create a 3D object (e.g. aring) 4) Fix albedo = 1 5) Rendering the ring under Grace Cathedrale illumination 6) Rotate SH model, and as a result, the scene should change in real-time I've managed to carry out step 1) using the prefilter.c function given [url="http://graphics.stanford.edu/papers/envmap/prefilter.c"]here.[/url] Now - how do I create a sphere that represents the model (similar to aforementioned project)? Thanks!
  9. Hey Ashaman! I think I understand it better everytime I discuss it. It'll become even better when I start writing code for it. I would like to start the following way: Display arbitrary objects (cubes, spheres, rings, ellipses, etc.) in a scene and have them rendered using SH. Any ideas on how I should start? Thanks!
  10. Hi guys! [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] This is my very first post on this forum [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] I'm very much new to OpenGL and I'm currently starting my newest adventure in this field - Spherical Harmonics. The idea I would like to implement it the following: [quote] A user interface (OpenGL or MATLAB), which displays an illumination model and a scene containing synthetic objects. The user gets to rotate/move/play around with the illumination model and, as a result, the image is rendered under the chosen illumination. [/quote] I have read through quite a few previous posts on this topic and googled the web (this is the most relevant project page: [url="http://graphics.stanford.edu/papers/envmap/"]Link[/url]), but there are still a few open questions. 1) What is the interpretation of a spherical harmonic model - it models the incoming light for each pixel on the surface, i.e. irradiance. And rendering is done based on the outgoing lighting power, i.e. radiance. Is this correct? 2) SH are said to be good for image with only low-frequency components. Why so? Could anyone provide with an example image, which is NOT suitable for SH modeling? 3) Spherical harmonics can be represented using cube maps or spheres. What is the difference - is one representation better than the other? Are there any other options - e.g. triangles, octaeders, ellipses, etc.? 4) Light probes can be used as environments maps ([url="http://www.pauldebevec.com/Probes/"]Link[/url]). Are there any other options? 5) I came across an excellent tutorial by Robin Green ([url="http://www.research.scea.com/gdc2003/spherical-harmonic-lighting.html"]Link).[/url] I also found a nice implementation of it, which I would like to edit: [url="http://www.paulsprojects.net/opengl/sh/sh.html"]Link[/url] Unfortunately though, I am not quite sure how/where to get started. Any suggestions? Looking forward to your response! [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]