Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Goreld
May 8, 2002

"Identity Crisis" MurdererWild Guess Bizarro #1Bizarro"Me am first one I suspect!"
Maybe less efficient but more accurate (and if you're dealing with scientific visualization this can be important) - use a HSL transform function for each vertex color, like haveblue mentioned.

If you use a texture, you'll get artifacts, and that can be really loving bad, as you may see stuff that doesn't actually exist. Even if you have antialiasing all the way up, and really nice anisotropic filtering, you can still get tiny artifacts, and depending exactly what you're graphing, this can be bad.

Also, if you need to change colors based on a power of the HSL function or on a logarithm scale, this can make the texturing problems worse (usually in the form of banding)


Stanlo posted:

Does anyone know how the "angled brush strokes" filter in photoshop works? I think it would be pretty darn cool if I could do this in real time. Unfortunately, I don't really know how it works after messing around with some test images. I get that it's doing some segmentation of light and dark regions to angle the strokes differently, but how are the strokes applied? I'm looking for a 2D solution for this.

It's probably a Gabor filter. There's a recent Siggraph paper that uses Gabor filters to create noise: here.

It's a well-written paper, which even includes some source code and a cool iphone app.

Goreld fucked around with this message at 18:10 on Sep 8, 2009

Adbot
ADBOT LOVES YOU

Goreld
May 8, 2002

"Identity Crisis" MurdererWild Guess Bizarro #1Bizarro"Me am first one I suspect!"

FlyingDodo posted:

Is there a standard way of fixing t-junctions for a bunch of polygons? At the moment all I am doing is checking each edge of every polygon against each edge of other polygons and inserting vertices/polygons as needed, with the whole thing accelerated with a BSP tree to remove checks that are not needed, but it still requires quite a number of polygon vs polygon checks. Anything to do with t-junction fixing on google is mostly related to how to fix them as an artist in 3d editing programs, not a programming solution.

There's no perfect solution.*

If your mesh is fully connected with say, half-edges, then you could detect open regions by looking for half-edges without opposites. Then you could perform zippering, and devise some way to split edges for the t-junctions without compromising the topology. Since you'd only be working on the detected boundary edges, this would work pretty fast, as you'd be culling out the majority of the mesh.

If you're dealing with a polygon soup, then you're going to deal with a whole bunch of robustness problems, and in that case, have fun! (I've spent plenty of time working on robust CSG operations, and my only advice is, well, you'll find out pretty fast whether or not you hate geometric modeling when dealing with problems like these)


*unless you're working with exact numerical computation, which is opening a huge can of worms

Goreld fucked around with this message at 21:23 on Mar 28, 2011

Goreld
May 8, 2002

"Identity Crisis" MurdererWild Guess Bizarro #1Bizarro"Me am first one I suspect!"

Nippashish posted:

I've implemented the marching cubes algorithm and I'm getting some strange behavior that I'm hoping someone here can help me explain. My code produces results that look correct so long as I make the magnitude of the isosurface I'm building big enough, if it's too small I get a surface full of really nasty holes.

Here's an example, this image is the 5000 level set of 1000*(sqrt(r2) + cos((x + y)/2.0) + cos((y + z)/2.0)):


But here's the 5 level set of sqrt(r2) + cos((x + y)/2.0) + cos((y + z)/2.0) over the same domain:


In case it's not obvious from the second picture, there are holes EVERYWHERE:


This happens regardless of the level of detail, or the range of the coordinate axes. As far as I can tell the only factor that affects it is the magnitude of the function I'm grabbing a level set from. Does anyone know what's going on here?

I would be tempted to say there's an issue with your interpolating between values along edges to find the zero-threshold, but the fact that your first example works means this is unlikely (unless your values are so frickin huge that you're getting NAN results)

The same goes for triangulation - the holes look like some of the marching cubes cases are screwing up, but the first example has no issues.

The frequency shouldn't matter as far as holes go, as marching cubes inherently generates a manifold. The result might look ugly, but there shouldn't ever be holes if you're consistent with your tube-case (where you connect opposite corners)


My guess is you might have screwed up the memory allocation or something. Are you linearly interpolating to find the zero-thresholds on the edges? If you're evaluating the actual function using some sort of minimization, it's possible that you could be getting results outside of the cube (and that would be slow as hell to compute anyways, not really worth it since Marching Cubes has enough aliasing problems).

Goreld
May 8, 2002

"Identity Crisis" MurdererWild Guess Bizarro #1Bizarro"Me am first one I suspect!"

Boz0r posted:

This is probably an esoteric question, but I'll ask anyway. I'm still trying to implement the gems from this paper: http://www-graphics.stanford.edu/courses/cs348b-competition/cs348b-05/gems/Project_Report_C.pdf

I've modelled the calculations for polarization state as a matrix that gets updated at each intersection. The thing I don't get, is how to weight the ordinary ray and the extraordinary ray. Anyone tried doing something like this?

The author mentions that there's some sort of tables with the refraction coefficients for natural crystals based on the angle from the axis; I'd guess that's where the ratio of ordinary-extraordinary strength comes from.


Xerophyte posted:

This normally isn't a problem and you're not telling us what you're actually doing to generate rays right now so that's a bit hard to answer precisely. The typical approach for a projecting camera is to take a rectangle in front of the camera that covers exactly the region you want to see (on the focal plane if you have one), find where the image space samples you want are on that rectangle and then send rays in their direction.


Isnt' this just depth of field? I'm not sure that answers the question; distorted spheres would be due to a field-of-view that's too wide (usually people end up choosing 90 degrees on their first raytracer)

Goreld fucked around with this message at 20:49 on Apr 4, 2013

Goreld
May 8, 2002

"Identity Crisis" MurdererWild Guess Bizarro #1Bizarro"Me am first one I suspect!"

pseudorandom name posted:

You want a texture array, not a 3D texture.

He could also use a texture atlas. Some people might pull out crucifixes and make hissing sounds, though.

Adbot
ADBOT LOVES YOU

Goreld
May 8, 2002

"Identity Crisis" MurdererWild Guess Bizarro #1Bizarro"Me am first one I suspect!"
Regarding the radiosity garbage renders, my first guess would be there's uninitialized memory in there, possibly in data you're uploading to the GPU? Are you running in release mode?

My second guess is that you have negative values in there - out of bounds values can do all sorts of weird poo poo depending on drivers. Try clamping the output maybe?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply