Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 07 Nov 2010
Offline Last Active Yesterday, 09:26 AM

#5227649 GI ground truth for comparison

Posted by CulDeVu on 06 May 2015 - 09:14 PM


I also don't like Blender Render because of all the thousands of presets that do things I'm not accounting for. Basically, it's hard to use for just making a simple test scenes to render.

Thought you don't like blender, it comes to (my) mind first. Blender's cycle, starting with a simple diffuse only material and some light sources. It is a path tracer and should deliver a pretty solid GI solution.


That's true, blender cycles is really nice and easy to use, much less painful than normal blender render used to be.


Also, on the topic of physical based vs correctness, that's very true. The big thing for me, though, is having results that agree with everyone else's results. 


Isn't POVRay a common choice for this sort of thing?


That's the crux of the matter, I don't know if it is or not. Thanks for the advice! :)


Arnold is very good, but also very not-free.

I've had some people recommend LuxRender, but I don't really have any experience with it myself.

Have you thought about writing a quick exporter tool to Mitsuba's file format? If you can do that, you can totally skip the pain of manually editing XML files. In fact I wasn't really advocating that you hand-write the XML in my blog post, I was just doing it as a way help familiarize people with the format and Mitsuba's functionality.


LuxRender looks fantastic, and Arnold looked amazing too in last year's SIGGRAPH!


The XML-exporting thing is a valid point, and it's something I could do. I've been using it to set up very simple scenes, so it doesn't matter too much as of right now, I was wondering for future alternatives. I'll look into LuxRender and POVRay though.


 Regardless, if the hug variety of pathtracing programs out there really aren't to your liking you could practice and write your own, if it means that much to you.


Funny enough, I did, and I'm not sure if the results from my pathtracer are accurate either. Kind of a catch 22 :P

#5227240 GI ground truth for comparison

Posted by CulDeVu on 04 May 2015 - 11:41 PM

Hello there!


So I've been wanting to put my renders up next to something for a comparison to test for correctness. It'd really be helpful if I could have a ground-truth form of the renders I'm doing. After all, being "Physically Based" sort of implies that it your renders sort of look correct tongue.png


I've tried some things, and I've heard of other things, 

- I've tried Mitsuba, as per MJP's advice, but I really can't get into it. It's good, but the XML is ridiculously obtuse and word-y.

- I also don't like Blender Render because of all the thousands of presets that do things I'm not accounting for. Basically, it's hard to use for just making a simple test scenes to render.

- I haven't yet tried Pixar's now-public Renderman, but I'm going to try that one out soon.

- I've read that Cinema4D has it all, but it's a little on the extremely pricey side


What sort of GI programs do you use, or would recommend, for comparing renders against?


Thanks in advance! smile.png

#5226703 Which is the best university in the "world" for Computer Graphics?

Posted by CulDeVu on 01 May 2015 - 08:19 AM

I think the institution you're looking for is the Internet. It's an impressive thing, really: it's the largest collection of human thought ever constructed, and most of it is completely free to the public!


If you really want to get started with realistic graphics, chances are you want to start taking a look at SIGGRAPH papers, GPU Gems, read developer's blogs and the like. That'll probably a much better teacher than you could ever get at a university, IMO.

#5213949 An alternative to the Sponza mesh for demos?

Posted by CulDeVu on 02 March 2015 - 10:26 AM

My personal favorite is a San Miguel scene that I've seen used a few times. A bunch of really nice ones are listed here: http://graphics.cs.williams.edu/data/meshes.xml

#5213934 Delaunay Traingulation

Posted by CulDeVu on 02 March 2015 - 09:38 AM


Now I'm struggling to produce a Delaunay Traingulation.  I'm trying to make my initial set of triangles by adding points randomly to the grid.  If the point is inside of the triangle, then the triangle splits into three smaller triangles.  If it is outside of another triangle then it finds the two nearest points and makes a new triangle with them.


This is not working at all. 


I'm not sure what's wrong with this, because this is completely correct, at least to create an arbitrary triangulation. You don't need to know baycentric coordinates to make it work, though. If your triangles are in counter-clockwise winding, a triangle with verts A, B, and C would be split as such: http://i.imgur.com/PNNEtkf.png




I've seen this concept of edge flipping in my travels.  I haven't been able to wrap my head around it well enough to turn it into code. Do you have a simplish explanation for what is going on?



Sure, I'll take a whack at it.


There are many ways to triangulate a set of points. Delaunay triangulation is a specific type of triangulation that seeks to maximize the minimum angle of each triangle, to avoid skinny triangles. Now, this doesn't necessarily mean that it's the correct or the only way of avoiding skinny triangles, it's just one method. See here for a more complete list of different ways to create optimal triangulations: http://en.wikipedia.org/wiki/Point_set_triangulation#Time_complexity_of_various_algorithms


So, in an effort to maximize the minimum angle, and taking advantage of the Delaunay property of circles, the easiest way to go about turning a random triangulation into a Delaunay one is to compare and correct adjacent triangles together. Something like:

for every pair of adjacent triangles
    if they aren't delaunay
        make them delaunay

, which is actually really nice. Not many other triangulation methods that I know of become correct just by correcting triangles piecewise like this.


The "make delaunay" step is the key here. It just so happens that the easiest way to make a non-Delaunay pair of adjacent triangles correct again is to turn the exterior vertices into interior vertices and vice versa


Hope that helped a little!

#5213836 Delaunay Traingulation

Posted by CulDeVu on 02 March 2015 - 02:01 AM

Just a quick question, do you want a Delaunay Triangulation, like your title suggests, or do you want a Voronoi mesh, like your post suggests? If you're calculating a Voronoi with the end goal of turning it into a Delaunay, then there are far easier ways to do it.


The only issue with your Voronoi algorithm is that your first step essentially requires you to make a Delaunay triangulation. Keep in mind that just because you can find create an arbitrary triangulation over a set of points doesn't mean that you are creating the inverse of the corresponding Voronoi diagram, which is what you need. Everything else about it seems like it should do the trick.


Fortunately, you can construct a Delaunay very easily by:

1) creating an arbitrary triangulation. There are many ways to do this, but the easiest way is to append and subdivide triangles as you add points to the triangulation. I can elaborate on that if you need.

2) edge flip 'till you can't flip no more ( http://en.wikipedia.org/wiki/Delaunay_triangulation#Visual_Delaunay_definition:_Flipping )


Hope this helps! smile.png

#5209627 Vector-based vs Tile-based worlds

Posted by CulDeVu on 09 February 2015 - 11:18 AM

Heyy all!


I'm starting to think that a vector-based world would make the game I'm creating look and feel magnitudes better. I'm going to try it out regardless, but I have bad memories of the last time I tried to make a non-tile based 2D platformer. It wasn't exactly a pleasant experience, so I'd like to know what you guys think.


For reference, here's an older video of the type of game I'm making:


Here's what I mean by vector-based worlds: http://higherorderfun.com/blog/wp-content/uploads/2012/05/Talbot_Bitmask_2.png. You know, games that don't just use tiles to block out the game world.


So, without a shadow of a doubt, tile based worlds are much easier to make, and much easier iterate upon. Unfortunately, they don't look as gorgeous as fully vector-ized ones. Tile-based editors like Tiled have functionality that allows you to create tile objects (like a platform), give them properties (like following a path or using a lua script), and other things that can make the process go a lot more smoothly.


So, last time I tried making a game without tiles or bricks, I used Illustrator to make the files, exported them as .SVGs, and parsed those to load game levels. Because there's no properties, I had to resort to naming layers to denote what objects had which properties (as names in SVG files could be easily parsed). But it all felt very hack-y, you know?


What are your experiences with vector-based game worlds? Did you ever find a good solution to the issues of:

  • a good vector-art program that's both fully SVG compliant (or compliant enough to relieve you of headaches, unlike Illustrator) and actually nice to work with?
  • world content generation (like procedural generating grass, flowers, etc to reduce the art generation burden)
  • texturing (because SVG doesn't really like texturing things, and especially doesn't like smooth transitioning texturing between different textures)
  • attaching scripts or other properties to different objects (like platforms, doors, enemies, etc)
  • ease of prototyping (cause let's face it, tile-based worlds are easy because, just looking at it, you can see whether or not it'll work. With vector-based overworlds, not as much)
  • other things I'm forgetting or haven't realized yet? tongue.png

Thanks in advance for the advice!

#5204231 Explain the shape of a specular lobe

Posted by CulDeVu on 14 January 2015 - 10:50 AM

The results look about right, if you take the x-axis to be the surface normal, and the specular power to be around 5 to 8 or so, it looks about right.

#5204135 Explain the shape of a specular lobe

Posted by CulDeVu on 13 January 2015 - 10:24 PM

Well, a function that you can plot won't really help you much when you're trying to do any sort of graphics programming. But if you *really* want a plot-able function, you can always take the phong equation for specular highlights, which goes something like


finalSpecColor = specColor * pow(dot(normal, halfAngle), specTerm)




halfAngle = normalize(viewDirection+lightDirection)


Once you have that, you can easily write a little program that steps through a bunch of different possible view directions on the unit circle and comes up with a simple plot of the outcome.


EDIT: I went ahead and made a quick little thing that shows the phong specular lobe for a given specular power. Mouse over to change the reflection direction biggrin.png https://dl.dropboxusercontent.com/u/45553463/thing/index.html

#5203740 What is the gradient symbol for

Posted by CulDeVu on 12 January 2015 - 02:02 PM

It's the Del operator: http://en.wikipedia.org/wiki/Del


Like Alvaro, said, each cooridinate of a gradient vector are the derivatives with respect to it.


For future reference, there's this really nice page that helps me out a lot: http://en.wikipedia.org/wiki/List_of_mathematical_symbols

#5196453 Slope physics

Posted by CulDeVu on 05 December 2014 - 09:58 AM

No, it looks like you're mathing everything okay.




If you don't want your character to move as far, just increase the friction coefficient. The coefficient of wet snow is generally 0.3-0.6 when in contact with rubber, so it it's probably a little higher than 0.2 for snow in contact with a snowboard.


Also keep in mind there's a lot of other forces at play here besides just friction. There's additional soft-body collisions happening when the snowboard cuts through the snow, there's the air resistance that goes into affect when the snowboarder goes fast enough, there's the difference between the top layer of snow that's wet and the lower layers that're probably dry that have different affects on the board. In the end, though, your game is going to be an estimate of reality, so don't be afraid to play with some numbers to make things look and feel right. It may not be mathematically correct, but a lot of times, it's all you can do :)


I'd recommend dialing up the friction coefficient, and adding air resistance, and that should be good enough for a semi-accurate simulation.

#5190428 Multiple lights give white

Posted by CulDeVu on 31 October 2014 - 11:22 AM

Long story short, you need to tonemap the values in your image. This is because your screen operates under the range [0, 1] and real light operates under [0, inf). This makes sense, because you can keep making a room brighter and brighter by throwing in more and more photons, but your screen can only get but so white. So you need to turn real-world brightness (HDR) into something the screen can display (LDR).

A really easy way to get started is to transform each RGB component in your image by
f' = f / (f + 1)

There are more advanced ways, but that's the jist of it. Throw it into your shader, boom! Your HDR image is now able to be viewed on a screen. I don't think it's able to be done in the fixed function pipeline, someone correct me if I'm wrong.

If you want to know more, start Googling around for HDR rendering.

#5185848 drawing a train - best methods

Posted by CulDeVu on 08 October 2014 - 03:06 PM



Amit Patel at Red Blob Games has got your back. He talks about bezier curves, arcs, tiles, and the pros and cons of each. I don't know about the trains themselves, but this can apply to the tracks, and how to space out the train cars, etc.

#5147829 SVG - Anybody using Scalable Vector Graphics and how?

Posted by CulDeVu on 18 April 2014 - 01:12 AM

Because I prefer to use Adobe Illustrator for vector art, and because the game I'm making is primarily vector-based, I export art as .svg instead of parsing .ai files. SVG files also contain lots of superfluous information in the form of XML, so I only use it as an in-between, translating it into my own data format better suited to my purposes.

Actually as long as the closed paths in your art don't have holes in the middle of them, triangulation is relatively straightforward. Ear clipping is the most common method, if you don't care about the slight performance hit.

My biggest qualm about SVG is animation support (for Illustrator at least, I can't speak for inkscape or the other vector art programs), and texturing support, primarily multitexturing. I would have liked the texturing problem to be nonexistent, but texturing everything makes the entire piece look a lot nicer :-)

So, long story short, it's a nice format for static, minimalist art, but it has serious drawbacks that should be looked at before you ditch rasterized graphics completely.

#5108339 Cylinder-Triangle Collision?

Posted by CulDeVu on 10 November 2013 - 02:26 PM

anyone have any good material for doing cylinder-triangle collision?




I agree with HappyCoder. It'd actually be easier if you use a capsule. What I'd do is: I'd turn it into a triangle-to-line-segment test. I'd shrink the capsule until it had a radius of zero (a line segment that extended from the base of each of the hemispheres on the end, going through the center of the capsule), and then find the minimum distance between that line segment to the triangle. Once you find that distance, you do a check to see if the radius of the capsule is larger than they distance between the capsule and triangle, just like you do with a cylinder-to-point test.


Also, I'd use an existing physics engine if I were you. It makes problems like these much simpler.