Material Creation tool for Sculptris...

BlitzMax Forums/OpenGL Module/Material Creation tool for Sculptris...

Taron(Posted 2010) [#1]
MaCrea, I'm calling this little app that helps create materials for sculpting apps like Sculptris or Zbrush.

However, Nvidia cards, again, have no trouble with this at all, but ATI is making problems as usual.
I don't know what I neglected this time in my GLSL construction, assuming the problem is there, but if anyone of you has any idea, I'd be thrilled to learn how to deal with those cards.




_JIM(Posted 2010) [#2]
Hi Taron,

I've tried looking through the shader code and everything seems to be fine but I can't get it to work properly (yay ATI!). Got some work now but later I'll try converting it to my little shader framework and see if I get lucky :-)


Taron(Posted 2010) [#3]
Ah, Jim, that would be awesome! It's such a painful stuff for me always... no idea why it has to be such a gamble. :{

THANKS in advance!


_JIM(Posted 2010) [#4]
Fixed it! As I said a while ago, ATI wants you to play by the book. The error was that the "&&" operator needs two bools instead of bool and int.

Not sure what that bg does, but here's the fixed code:



My little shader framework has a "DebugLog" output when shader compilation fails. The error popped in there and it was really easy to fix :-)

A bit offtopic: Taron, I want to chat a bit with you. Any way I can contact you?


Taron(Posted 2010) [#5]
I just sent you an email! ;)

THANK YOU a million times! I really would be thrilled, if that was all! Nothing else had to be changed? Just the if "(len>1.0 && (bg>0))~r~n discard;"?
Wow... in some ways that's a slap in the face, hahaha, and scary, actually. But if that's all... my god. I have to get more disciplin into my coding. I wanted to make BG a bool, but couldn't find a uniform connection at byte level, just int, floats and their arrays. BG is a switch to turn on or off the processing of the area around the sphere. Silly little gimmik, really, but it was a request.

Again, THANK YOU so much, Jim!
I'm a fan of your spirit, you're a real example!


_JIM(Posted 2010) [#6]
That was the only modification, yes.

I myself would have coded like that a while ago. However, I've stumbled upon this error more than once (not in GLSL though) and made a habbit of checking ints (and ESPECIALLY floats) with > or ==.

I said especially floats because they have a habbit of not being precisely 0 :)