Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TC-Ray : need for a smoothing routine?
#1
Jark: Could you indicate me a shape where the smoothing routine is needed?
I generated two Holed cubes, one with and one without the smoothing routine,and i can't distinguish both bmp, even if i zoom them. Maybe this is not the right example?
Antoni
Reply
#2
It highly depends on the view angles, but, as far as I remember, with alpha=-20 and Beta =-20, there are black spots on the classical torus, and sometimes undesired pixels outside the torus, along one of the horizontal axis...
hink Global, Make Symp' All ! ®
[Image: Banner.gif]
Reply
#3
Yes, it happens with torus. And filtering does'nt solve completely the problem. I'll see if i can find a solution
Antoni
Reply
#4
but this filter was written "de chic", without really thinking about something smart, on the basis of my (old) memories about radar target tracking (lol).

Since then, I discovered some call these techiques anti-aliasing, but did not take time to really re-write that.

I'm seriously thinking about re-writing TC-Ray: I would like to implement a spheric projection instead of the existing plan projection, and it would be a nice opportunity to get back to a more conventionnal approach of ray-tracing...
hink Global, Make Symp' All ! ®
[Image: Banner.gif]
Reply
#5
Radar tracking? You were in the army?

I think the only thing that needs re-writing are the shape routines, they are too complicated. I would divide them in a part calculating if the point is in the shape and its z and another one to calculate light reflection and textures. This way only z would be calculated when finding the closest shape. Once the shape to draw is found, the brilliance and texture could be calculated. Note the second part is just the same for all shapes.
Antoni
Reply
#6
except that the calculation of brilliance, etc..., relies on the normal vector which depends on the implicit equation of the shape: that does not leave much for the rest.

Moreover, I reached the limits of QB in terms of number of variables, etc..., and I have stack overflow issues each time I try to call Shape4 in a sub. If I introduce one more level, well...

The most tricky, for me, is to design a smart texture routine: as you may have noticed, I apply the fractal patterns via hard-coded lines, and it's not very handy. Since I'd like to avoid ahaving to many shared variables, I have to think about a different approach...
hink Global, Make Symp' All ! ®
[Image: Banner.gif]
Reply
#7
I was not in the army, but I started my carreer in the weapon systems industry, participating to the SDI project (remember, Reagan's starwar). I was in charge of the design of anti-missile radars. I originally have a engineer degree in signal processing, but I have to admit I lost most of my maths knowledge...
hink Global, Make Symp' All ! ®
[Image: Banner.gif]
Reply
#8
You have stack overflows because of too many local variables. To avoid it you can use STATIC variables. These are created at the start of the program and preserved between calls (so they need to be initialized each time the routine is called)
Another idea: Shape calculations can be formulated as matrix operations, and matrix can be dynamic.
Antoni
Reply
#9
Sounds attractive... Do you mean something like:

(Intersection & Normal) = (ShapeMatrix) x (RayOrigin & RayVector) ?

(I'm just trying to figure out what you mean to put in a matrix here)

By the way, Antoni, did you see my two questions about your flood fill algorithm ?
hink Global, Make Symp' All ! ®
[Image: Banner.gif]
Reply
#10
I mean something like that. I hoped you would tell me how the equations look....
Antoni
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)