Re: mmmm rounded corners

Date : Fri, 2 Mar 2007 01:23:42 +0100
To : XSI(at)Softimage.COM
From : "Daniel Rind" <daniel.rind(at)gmail.com>
Subject : Re: mmmm rounded corners
Square Root of -2, which would be complex. Or more commonly in shaders, square root of something just a tiny bit less than zero. Happens easily with something like:
 
miVector  normal1, normal2;
 
[... fill normal 1 and normal 2 with almost identical vectors, slightly longer than 1.0 units...]
 
miScalar norm_diff = sqrt(1.0f - mi_vector_dot(&normal1, &normal2)); // dot product will be something like 1.000000001, resulting in square root of -0.00000001 --> not a number
 
which can be easily fixed by clamping the dot product to the [-1...1] range.
 
Ciao, Daniel!

 
2007/3/1, Kim Aldis <XSI(at)kim-aldis.co.uk>:

Used to have a tool that would fix single pixel anomalies. Never mind.

 

 

Sqrt( -2 ) ??

 

.

From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf Of Chris Marshall
Sent: 01 March 2007 16:42


To: XSI(at)Softimage.COM
Subject: Re: mmmm rounded corners

 

No, they look about 3x3. This was explained by Daniel Rind the last time this was mentioned:-

Dan wrote:-
snip
Nope, they are something like sqrt(-2) or 10/0.

And it's in the nature of the floating point specification, that whatever you do mathematically with a NAN or INF value, it will prevail. INF - 10 is still INF, and 12 * NAN is still a NAN.

So when mental ray applies it's filter kernel (which is by default a 3x3 Gauss in XSI now), then every pixel touching your NAN value will also be a NAN, which results in a black splotch that scales with your filter size.

Swarfega elegantly throws away the samples that are not a number or infinity, but ultimately you should try to find out which shader is causing them, and report / replace / fix it.

Ciao, Daniel!

snip




Kim Aldis wrote:

Is it single pixel black dots Chris?
 
 
  
-----Original Message-----
From: owner-xsi(at)Softimage.COM
 [mailto:owner-xsi(at)Softimage.COM] On
Behalf Of Chris Marshall
Sent: 01 March 2007 15:58
To: XSI(at)Softimage.COM
Subject: Re: mmmm rounded corners
 
When I get a chance, I'll dig the scene out.
 
 
Daniel Rind wrote:
    
The lens shader is a band-aid to get rid of the symptoms, but the
problem (a
buggy shader) remains.
 
Ciao, Daniel!
 
 
2007/3/1, Chris Marshall <chris(at)eclipsecreative.co.uk>:
      
I thought you'd already identified this problem, which was why you
        
wrote
    
the swarfega lens shader?
 
 
Halfdan Ingvarsson wrote:
        
Do you have any example scenes that you can send me, which I can
          
then
    
forward to mental images, so that they could pinpoint the error and
fix it?
        
Thanks,
 
 - ½
 
_
          
 
 
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in
body:
unsubscribe xsi
    
 
 
---
Unsubscribe? Mail Majordomo(at)Softimage.COM
 with the following text in body:
unsubscribe xsi
  

 

--- Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body: unsubscribe xsi



Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.