Jump to content


Photo

Clrelight Opencl Fuse


  • Please log in to reply
25 replies to this topic

#1 iLuso

iLuso

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 88 posts

Posted 09 April 2013 - 05:04 AM

ReLight OpenCL fuse.
v0.92

Hey, guys!
This is my first fuse. I think the name speaks for itself.
I don't have time to write the documentation, maybe a some later.

clReLight works only on OpenCL, and you must have powerful GPU with more RAM
clRLT_DisplaceGeometry.setting - macro for simple lights setup
clRLT - Lights Connector.eyeonscript - tool script for fast lights connectin
clReLight_Demo_v1.comp - Demo :D

New ver 0.92 all changes in Extra Tab
Attached File  clReLight.txt   99.24KB   16 downloads save as clReLight.fuse

Old ver. 0.9 with samples
Attached File  clReLight.txt   19.75KB   25 downloads save file as clReLight.rar

Tips:
1) Position Pass input must have real alpha, for divide (see Extra tab). It's fix edge artifacts.
2) For more smooth result use filtering (see Extra tab). It's up and down scale all chanels with bi-linear filter.
3) If you need to use only one mask, don't use mask input. You can put your mask in Normal Pass Alpha, and then use it. It's more faster, and less memory!

P.S. Version 1.0 will come soon, fully rewrited, and i hope production ready.

#2 leif3d

leif3d

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 554 posts

Posted 09 April 2013 - 11:18 AM

Great tool!
I have some artifacts here and there, but overall great tool.

Why do you need the color id inputs BTW?

#3 iLuso

iLuso

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 88 posts

Posted 09 April 2013 - 11:59 AM

Great tool!
I have some artifacts here and there, but overall great tool.

Why do you need the color id inputs BTW?

Thanks!
Show me what artifacts you have, may be i fix it.

For create separate materials, Like plastic, skin and metal. It's more fast when all cals's in one tool.

#4 iLuso

iLuso

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 88 posts

Posted 09 April 2013 - 12:16 PM

Tips:
1) Position Pass input must have real alpha, for divide (see Extra tab). It's fix edge artifacts.
2) For more smooth result use filtering (see Extra tab). It's up and down scale all chanels with bi-linear filter.

#5 Tilt

Tilt

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 2,137 posts

Posted 09 April 2013 - 04:15 PM

I'm not on a machine with a proper GPU right now, but I've looked at the code. holy schmoly! That looks really awesome.

Imagine if you could access the 3d scene data inside a Fuse... :mf_w00t2:

#6 Tilt

Tilt

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 2,137 posts

Posted 10 April 2013 - 01:40 AM

iLuso, this is the error I'm getting:


OpenCL : :313: error: no matching overload found for arguments of type 'float const, int'
	 float4 epsilon = (float4)(1.0f - sqrt(pow(angle, 2)), angle, 0.0f, 0.0f);
										 ^~~~
:444: error: no matching overload found for arguments of type 'float, float __attribute__((ext_vector_type(4)))'
	 shaderSpec = max(0.0f, (Cs * reflect * max(0.0f, pow(-dotVH, 3.0 / (1.0 - smoothV))) * sInt * SpecColor * specInt * 1.6f));
					 ^~~

(those ^ are pointing to sqrt and max())

I guess that's because my card doesn't support the latest OpenCL?

#7 iLuso

iLuso

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 88 posts

Posted 10 April 2013 - 02:31 AM

What card you have?
I tested fuse only with nvidia GF 470 and GF 670.

#8 iLuso

iLuso

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 88 posts

Posted 10 April 2013 - 02:50 AM

iLuso, this is the error I'm getting:


OpenCL : :313: error: no matching overload found for arguments of type 'float const, int'
	 float4 epsilon = (float4)(1.0f - sqrt(pow(angle, 2)), angle, 0.0f, 0.0f);
										 ^~~~
:444: error: no matching overload found for arguments of type 'float, float __attribute__((ext_vector_type(4)))'
	 shaderSpec = max(0.0f, (Cs * reflect * max(0.0f, pow(-dotVH, 3.0 / (1.0 - smoothV))) * sInt * SpecColor * specInt * 1.6f));
					 ^~~

(those ^ are pointing to sqrt and max())

I guess that's because my card doesn't support the latest OpenCL?

I think a problem was here "pow(angle, 2)", pow can't work with integer in old versions. I corrected it wherever found. Should work.


#9 ChadCapeland

ChadCapeland

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 1,975 posts

Posted 10 April 2013 - 08:46 AM

sqrt(pow(angle,2))? Wouldn't that just be angle?

#10 iLuso

iLuso

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 88 posts

Posted 10 April 2013 - 09:02 AM

:blush: abc() don't work.

#11 ChadCapeland

ChadCapeland

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 1,975 posts

Posted 10 April 2013 - 09:23 AM

abc() isn't a built in function. What is it?

#12 Gringo

Gringo

    Associate Administrator

  • Adv Members
  • PipPipPipPipPip
  • 1,455 posts

Posted 10 April 2013 - 09:56 AM

I guess, it's abs(), which would be the same as ((x)^2)^0.5
http://vfxpedia.com/...raries/math/abs

#13 Tilt

Tilt

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 2,137 posts

Posted 10 April 2013 - 10:11 AM

could be. It's fabs() in OpenCL if I recall correctly.

#14 iLuso

iLuso

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 88 posts

Posted 10 April 2013 - 10:30 AM

I did not look particularly :)
fabs() works, I fix it in next release :)

#15 Tilt

Tilt

    Flying Pig

  • Adv Members
  • PipPipPipPipPip
  • 2,137 posts

Posted 11 April 2013 - 10:06 AM

I had to change the shaderSpec line to

shaderSpec = max( (float4)(0,0,0,0), ......)

to make it work. impressive tool!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users