Uses of curves in graphics?

Started by
10 comments, last by Atrix256 8 years, 10 months ago

Hi Guys,

I'm working on a presentation for my fellow engineers and am trying to gather some info about the usage of curves in graphics and graphical effects. Less about vector graphics type stuff and more about visual effects - but if you have interesting vector graphics info, I'd love to hear that too!

My questions are...

1) What are some interesting techniques involving curves in graphics? (e.g. particle color over their lifetime, uses of curve based color gradients)

2) Do you currently use curves in your graphics work? If so, how are the curves used? Do you use them while making a texture? Do you use them in a fragment shader? How are they passed into the shader - hard coded into the shader? uniform constants? baked out into a texture (if so what dimensions / format)?

Anything else you think I should have asked about? smile emoticon

Thank you!!!

Advertisement

I think you just answered the question yourself. All of those are valid options. :)

As you said: most of the time it boils down to discretizing the curve into something like a texture or a couple of coefficients if you can get away with a low-order polynomial. Color Correction would be one example where you would fiddle around with color-curves in Photoshop and discretize the resulting mapping into a small 3D texture, the Color LookUp Table (LUT). You would then use that in your shader program because it's just a quick lookup.

They are e.g. also used to model props and architectural CAD-like structures. It's just more convenient in some cases than messing around with triangles. Of course, there are also lots and lots of applications besides games like non-realtime CNC-machining, which needs as much precision during modelling as you can possibly throw at the system to get good results and run fancy math algorithms on those curves (Differential Geometry).

Lots of options, anything goes, really.

"Some people use Singletons, some people are Simpletons." - Bill Gates
"Yum yum, I luv Cinnabon." - Mahatma Gandhi

I answered in a general way, but I'm looking for specifics. Something like "here's how i use curves in my shaders and here's how i get the curve data to the shader" type answers.

(and aiming more towards graphical effect type stuff, and less towards vector graphics applications)

I'm writing a research paper on something relating to curves and GPUs specifically (the presentation is for the paper), and am trying to find example uses of curves in graphics, as well as ways people get the curve data to their shader currently. Things that people ACTUALLY do, instead of theoretical ways to achieve things.

Color correction is a nice answer, thanks for the response! I'll bet color correction type curves would help too in doing tone mapping for HDR.

Lighting response curves - http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html

http://blog.selfshadow.com/publications/s2013-shading-course/karis/s2013_pbs_epic_slides.pdf

SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
We used tons of curves for driving the behavior of our GPU-simulated particles. How they spawned, how the moved, what color they were, etc. For the most part we didn't really evaluate curves directly on the GPU, we would instead quantize the curves into a big lookup texture that contained the quantized values for all curves being used by the active particle systems. We did similar things for having the artists specify distance and height-based falloffs for fog effects.

I'm not sure if this is exactly what you're looking for, but you should take a look into tessellation and subdivision surfaces. These algorithms generally work by treating the mesh positions as control points on a spline, and then evaluating the curve to generate intermediate vertices. The Open Subdiv project has tons of info about doing this on a GPU using compute shaders and tessellation hardware.

oh man... i am so stoked to hear you say that MJP. Thank you as well Promit. You two guys have given me a bunch to work with (:

When I think "particularly cool use of curves in graphics" the train sequence in Uncharted 2 comes to mind. They used curves (Catmull-Rom splines) to drive the train movement. There was a GDC presentation about it (look for Multiprocessor Game Loops: Lessons from Uncharted 2).

I've always found the CSS documentation on MDN to be a nice overview of timing functions: https://developer.mozilla.org/en-US/docs/Web/CSS/timing-function

Also check this out: http://www.gdcvault.com/play/1020583/Animation-Bootcamp-An-Indie-Approach (It starts at movement continued with a full animation system defined by curves)

Hey @MJP, can you tell me why you guys opted to use textures for your curves, versus say, passing the control points and/or tangent data through as uniform constants?


We used tons of curves for driving the behavior of our GPU-simulated particles. How they spawned, how the moved, what color they were, etc. For the most part we didn't really evaluate curves directly on the GPU, we would instead quantize the curves into a big lookup texture that contained the quantized values for all curves being used by the active particle systems. We did similar things for having the artists specify distance and height-based falloffs for fog effects.

Sorry for the slightly OT.

I am with Atrix here, MJP could you indeed explain why you went with a lookup table, I always worked under the guideline that memory and bandwidth was a precious resource while I could burn some ALU cycles.

OT IIRC tone mapping and color grading uses curves, someone please correct me if I'm wrong.

-potential energy is easily made kinetic-

This topic is closed to new replies.

Advertisement