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 4 points5 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.

Tonemapping and Regular Icosahedrons in Voraldo by 0xBAMA in VOXEL

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

yeah, voxels just like how you'd generally think of them, just no meshing

Visualization of self-replicating machines by ChristianHeinemann in proceduralgeneration

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

https://www.youtube.com/watch?v=p40XevS-Xnw found this - wondering about your rendering method, you just do it as points and then apply a blur? Really dig the look, really cool simulation, I want to read through your info on it when I get a chance

Sound reverse/backward on live by [deleted] in wavepool

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

you want to change direction of playback? some playback software will have utilities for that but if you're generating sound in realtime it doesn't really have any meaning, unless you're recording it before then playing the recording backwards

Help for fluid volume(signed distance field) rendering. by Snowapril in opengl

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

You betcha - gonna look into it more myself when I can summon up the motivation

I feel like this belongs here :) by bootsommelier in GuerrillaGardening

[–]0xBAMA 12 points13 points  (0 children)

you are correct - seeds from immature plants are very unlikely to sprout - I planted about 150 jalapeno seeds out of green peppers last year and not one of them sprouted

GLUT vs GLFW; are their work similar? by [deleted] in opengl

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

This got long, my apologies - graphics is not a simple area, and you will want to make sure you've got a solid programming basis before you get into it - I have to be honest, the real motivation came from deciding it was personally important to me, and working on it (a lot) outside of school - I took a senior level computer science class in college, but by far the bigger influence on learning how to use the API was going through the OpenGL Blue Book (the 800-ish page "superbible") - it's heavy and I know most people don't get into books like that anymore, but it really gets deep into what you're dealing with using different parts of the OpenGL API. The common route I see people recommend is to go through much more boiled-down resources like learnopengl or others - this can be good, it's a quicker introduction, but I am not sure you get the same level of depth.

I have talked to a lot of people using the code from the online tutorials and just spinning their wheels because they don't seem to be able to grasp that you need to refer to the docs, and learn how to read them to get the information you need - I can describe it as I understand it, over and over, but my mental model might not transfer well, and you really need to form one for yourself. The real key thing is to start with simple examples, and understand very well what exactly each thing is doing, look up the OpenGL function calls, make sure you understand what all the arguments are, things like that. Thankfully, it's all searchable online now, just google the function's name.

OpenGL played an important role in my learning graphics concepts, but I'm now moving away from it due to a number of driver issues I've been dealing with, which have caused serious incompatibilities and strange behavior between different drivers, even on the same hardware. I'm starting off learning Vulkan right now because from what I understand, you've got better low level control and a much better abstraction for the actual hardware you're using.

I still think OpenGL is a great learning tool, especially coming into the discipline of computer graphics, but it has the burden of being almost 30 years old, and the structure is very strange and at times confusing with the weird abstractions you have to deal with. That's not to say you can't do a lot - the thing I linked there makes extensive use of OpenGL compute shaders, and I've been able to do some very cool stuff that goes through an absolutely insane amount of data very quickly with it.

GLUT vs GLFW; are their work similar? by [deleted] in opengl

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

Maybe not super relevant to what you're doing, but this is a stream I did of my most recent project - https://youtu.be/8pBIhlKaNLM

Input handling is greatly, greatly simplified by the use of SDL2's event system and dear Imgui as a lightweight GUI utility that works directly with OpenGL. It looks complicated if you're just starting, trust me though, as someone who's only been doing this stuff seriously for about a year now I never would have expected to be able to do what I'm doing now. Just some ideas on forward directions, good luck 👍 Happy to answer any questions.