handling UV discontinuities

Started by
16 comments, last by mrbastard 12 years, 4 months ago

You don't need an extra pass, the derivatives of any value can be calculated in a pixel shader using ddx and ddy. You could use those to detect discontinuities, and clamp your gradients to a smaller value to prevent going down to a smaller mip level.

Excellent, thanks again. I kind of thought that was the case but wasn't confident enough in my understanding to be sure.

I've been getting very useful results doing this. I'm going to have to spend some time working out how best to apply it to the different parts of the image, but I'm definitely getting close now. I'll post another screenshot when I'm happy with the results - hopefully this weekend.

[size="1"]
Advertisement

I agree with Hodgman - the effect looks fantastic. Lateralus is one of my favorite albums.... I would love to see a video of this in action! Great work!

Thanks! Likewise, I love Lateralus. I saw Tool in Berlin on the 10,000 Days tour, and hearing (feeling in the case of the bass drum) Danny Carey's drumming on Laterlaus was incredible.

I'm not sure how much more time I'll put into the demo once this issue is fixed. I had plans for a 'narrative' - keyframes of constant buffers for different parts of the song, interpolated as needed. I'd also very much like to make the central flame billow with a bit of sin().

This is the only problem with fractals - the possibilities are endless!

I should point out, my original inspiration for this technique was an image by Inigo Quilez. I spent a lot of time looking at the bunny image, trying to see what he was doing, and if there was a way to do something similar in real time. Where Inigo actually traps against the alpha channel to get the perfect outlines, I'm just trapping against a circle. The alternative would need a texture sample per iteration of the mandelbrot algorithm - up to 128 in my implementation.
[size="1"]
I'm jealous, I've always wanted to see Tool live. :P
What do you think about contributing a sample application to Hieroglyph 3 that implements this algorithm? If you don't have time to translate from your code to the Hieroglyph basis, then I could volunteer to do the conversion for you. It seems like a cool enough application that it should live on somewhere :) And of course you will be credited with your work.

About Tool - I haven't seen them live in quite a while now, not since they were touring in the U.S. for 10,000 days. I can't wait to see them again, but I'm pretty sure that won't happen until the next album comes around (which could take a while given their past history...).
Who'd have thought there'd be so many graphics programmer Tool fans!



What do you think about contributing a sample application to Hieroglyph 3 that implements this algorithm? If you don't have time to translate from your code to the Hieroglyph basis, then I could volunteer to do the conversion for you. It seems like a cool enough application that it should live on somewhere :) And of course you will be credited with your work.

Great idea, I'd love to. I've been meaning to spend some time with Hieroglyph since I bought the book last month. biggrin.gif I'm guessing it'll be fairly easy to convert as it's pretty much all in the pixel shader. The only real exception to that is use of FMOD to play back the sound and do FFT to give me the current sound spectrum. The spectrum goes in an array in my constant struct and is used to distort the trapping shape, UVs and colours in time to the music. Not necessarily a big loss though, as I haven't yet found a way to use it that I'm satisfied with.

Anyway - I'm hoping to work on the texturing problem over the weekend, and probably finish up the demo over the next couple of weeks. Then I'll have a look at translating it to Hieroglyph.
[size="1"]
Yes, I see a pattern forming about graphics programming and Tool...

The rest of the application sounds cool - I don't have any bindings to FMOD, but that is primarily just to minimize the number of dependencies that the library has. Perhaps I can check out some of the audio tools that are already in the DXSDK, and see if something can fit in there in the place of FMOD...
Who'd have thought there'd be so many graphics programmer Tool fans!
I never would've known if not for this thread laugh.gif

P.S. it would be cool if you found a way to incorporate a Fibonacci spiral to go with the lyrical composition of Lateralus ;)

The rest of the application sounds cool - I don't have any bindings to FMOD, but that is primarily just to minimize the number of dependencies that the library has. Perhaps I can check out some of the audio tools that are already in the DXSDK, and see if something can fit in there in the place of FMOD...

Great, thanks.


P.S. it would be cool if you found a way to incorporate a Fibonacci spiral to go with the lyrical composition of Lateralus ;)

Funnily enough the Fibonacci sequence (arguably) crops up in the Mandelbrot set in a few places - the bulb size/periodicity for example. I say arguably because there's a whiff of numerology to it I think - if you go looking for numbers and relationships in the set you're bound to find something!


I was going to vary the power used in the mandelbrot function according to the vocal rhythm, e.g.:
"black" : z=pow(z,1)+c : (the set is a circle)
"and" : z=pow(z,1)+c : (the set is a circle)
"white are" : z=pow(z,2)+c : (the set is a normal mandelbrot set)
"all I see" : z=pow(z,3)+c : (cubic mandelbrot set)
"in my in-fan-cy" : z=pow(z,5)+c : (quintic mandelbrot set)
"red and yel-low then came to be" : z=pow(z,8)+c : (octic(?) mandelbrot set)
"reach-ing out to me" : z=pow(z,5)+c : (quintic mandelbrot set)
"lets me see" : z=pow(z,5)+c : (cubic mandelbrot set)

Definitely would be cool to have an actual spiral for the "swing on a spiral" bits though smile.gif I'll put my mind to it.

[size="1"]

This topic is closed to new replies.

Advertisement