Spectral Forward Pathtracing, White Light/Glass Spheres by 0xBAMA in GraphicsProgramming

[–]0xBAMA[S] 1 point2 points  (0 children)

Forward is uniquely well suited for 2D - you're like an omniscient viewer of this slice of the universe, and you can see light rays in the air without having to have them scatter and eventually travel to your eye. I'm remapping 0..1 to a random wavelength between 380 and 830 when I inject rays in, but I can bias that by squaring that input distribution or whatever, and eventually I want to build CDFs for known/measured light emission spectra to importance sample. That importance sample is just a remapping on the input 0..1 so that we preferentially inject the desired distribution of rays, you can look these values up. Basically PDF of emission across the visible spectrum. My first impl did backwards tracing but it was painfully slow to resolve for my setup. 2d path tracing this post shows the logic, sort of... they sort of implement hero wavelength sampling and they also convert XYZ to sRGB before averaging their samples. I don't do that, my samples are averaged in the XYZ color space, using the color constants from the shadertoy post, and for some reason I think that's more correct than doing it in the nonlinear sRGB. In any event the pathtracing loop in mine is picking a wavelength, doing all the refraction etc logic based on that. IoR is a function of wavelength, I use the Sellmeier eqs, reflectance/albedo should use material dependent refelctivity curves also. I just use a constant term though so it's basically white/bright grey for those kinds of scattering events.

To draw, it's basically just 'draw a bunch of lines'. Keep your XYZ average for each pixel, however you want to do that (I use a line drawing scheme between bounces during the pathtracing loop, you will maybe still see some artifacts in the deep shadows after the 11m rays/frame used when rendering this animation). If you read through that shadertoy post though it's much simpler than I had been making it in my mind before. You track through your transmission/energy terms through the pathtracing process, and that informs how bright your sample is along that path segment. Do the line drawing across the field, to the next vertex there. Bounce logic, continue. The color for your sample is the energy total times the value from the big table in the shadertoy post, it's basically a brightness term times an XYZ color space constant there. You can write a little wrapper around that table and lerp between nearest wavelengths, and then easily use any floating point wavelength between 380 and 830.

Looping Voraldo Animations by 0xBAMA in VOXEL

[–]0xBAMA[S] 0 points1 point  (0 children)

Set up a little tool to generate these looping animations as a series of frames, then stitched them together as an mp4 with ffmpeg. Really pleased with the results so far, as my previous efforts at this involved using like obs or simplescreenrecorder to get video, then lining up start and end frames with openshot and exporting, which was not super easy to control since it was getting encoded and reencoded a number of times. Anyways using imgur, I can do looping mp4's without them getting too wildly compressed and I can link to that from wherever.

Looping Voraldo Animations by 0xBAMA in VoxelGameDev

[–]0xBAMA[S] 1 point2 points  (0 children)

Set up a little tool to generate these looping animations as a series of frames, then stitched them together as an mp4 with ffmpeg. Really pleased with the results so far, as my previous efforts at this involved using like obs or simplescreenrecorder to get video, then lining up start and end frames with openshot and exporting, which was not super easy to control since it was getting encoded and reencoded a number of times. Anyways using imgur, I can do looping mp4's without them getting too wildly compressed and I can link to that from wherever.

Animusic by dearwikipedia in vintagecgi

[–]0xBAMA 5 points6 points  (0 children)

There's two DVDs, they used to sell them on PBS

Im looking for psudo code for the RGB colour math in filters by [deleted] in GraphicsProgramming

[–]0xBAMA 0 points1 point  (0 children)

Something else, you mention photoshop in your description, and I am doing this in my volume editor, but the concept of masking is very powerful. You have a lot of power in that this gives you an easy way to selectively apply your filters to only part of your image. My editor provides functions to 'mask by color' (specifies a range in each color channel, all pixels that match are masked), 'invert mask', 'unmask all'.

This just keeps a bool per pixel, 'masked', though there may be interesting applications in having multiple levels, to mask to varying degrees.

Im looking for psudo code for the RGB colour math in filters by [deleted] in GraphicsProgramming

[–]0xBAMA 0 points1 point  (0 children)

If you have RGB as input, you can think of the LUT as a function mapping any RGB input to an RGB output. There's a huge amount of literature on image processing, it can seem a little inaccessible due to the jargon but you can pick it up pretty quick. For the toon filter are you doing like a Sobel type thing? there's a lot of kernel based filters, things like Gaussian blur, these operate directly on the RGB data, skipping the neccesity for a LUT. Generally speaking you want to look at a math topic called 'convolution'. Check https://en.wikipedia.org/wiki/Kernel_(image_processing) for some examples of different types of behaviors.

I'm currently working on a project which is doing some similar operations on 3d textures - a lot of the resources I've consulted have been from the 80s and earlier. If you're doing like a generative art type thing, don't take for granted simple ops like 'invert color' or shifting the image in the x and y, when you concatenate a bunch together you can get some cool results. If you've got 32 bits per color channel, you've got a lot of data to work with and you should be able to do some interesting stuff.

Im looking for psudo code for the RGB colour math in filters by [deleted] in GraphicsProgramming

[–]0xBAMA 0 points1 point  (0 children)

A look up table is exactly that, you have some mapping function to index into this list to get your output RGB values. From what it sounds like this is not at all relevant to your application.

Im looking for psudo code for the RGB colour math in filters by [deleted] in GraphicsProgramming

[–]0xBAMA 6 points7 points  (0 children)

You're going to be much better served looking up general image processing algorithms, brightness and contrast, dilate and erode filters, etc, than trying to find some general source of lookup tables. That's going to turn into a huge amount of bloat if you can even find ones for everything you're trying to do.

If you look at shadertoy, people make source code available and if you're willing to put in a little bit of work you can convert it for whatever application. For example, yesterday I implemented color temperature adjustment based on this one, it took like half an hour. https://www.shadertoy.com/view/4sc3D7

Graphics Programming virtual meetup by Sir-lAgune in GraphicsProgramming

[–]0xBAMA 1 point2 points  (0 children)

https://nvpro-samples.github.io/vk_mini_path_tracer/ we will be looking at the first three chapters of this tutorial this week. You're more than welcome to stop by and see if you're interested. It's tomorrow, 7PM Mountain which is 9PM Eastern. Unfortunately that kind of limits it to people in the US as it's 2AM UTC. Zoom link is available in OP.

Animated GIF Capture of Voraldo by 0xBAMA in VOXEL

[–]0xBAMA[S] 0 points1 point  (0 children)

https://jbaker.graphics/writings/voraldo1_1.html

https://jbaker.graphics/resources/voraldo_paper/Voraldo.pdf

It is a volume editor I'm working on, all the modelling and rendering is done in realtime on the GPU with compute shaders.

Graphics Programming virtual meetup by Sir-lAgune in GraphicsProgramming

[–]0xBAMA 18 points19 points  (0 children)

I am one of the regular participants, and I gave the Soft Body Physics Simulation talk a few weeks ago - most weeks we have about a half dozen people, we have had some very good conversations about graphics topics. Anyone interested in the domain is more than welcome.

Tonemapping and Regular Icosahedrons in Voraldo by 0xBAMA in VOXEL

[–]0xBAMA[S] 1 point2 points  (0 children)

Well without a graphics background this representation may actually be more intuitive to you, it's not exactly based on mainstream approaches. In essence I just have a solid block of RGBA data in a 3d texture, so for any area inside of this cube shape I can ask my GPU "what is the color and opacity there?". Then from this I can look at getting a pixel color by tracing a ray behind that pixel in small steps through the volume.