THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 12/05/2009 at 17:17, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 10.1/11
Platform: Windows ; Mac OSX ;
Language(s) : C++ ;
---------
Hi,
I have a channel shader (class ShaderData), to give color to the clones created by my clone generator. When the clones are created, I store each clone's UVW coordinate.
In my shader's Output() function, I use the UVW coordinate of the clone that's being hit by the ray, to sample from another shader (class PluginShader), in this example it's a checkerboard (but it doesn't matter, which shader I use).
So it's not important where the ray hits a clone, it will always get *one* UVW coordinate for each clone.
Now here's the result:
_<_img border="0" src= "http://dev.c4d-jack.de/public/surfacespread/shader/surfacespread_shader_frommaterial.jpg"_>_
Looks kinda odd, hm? I know the color of each sphere is being sampled from the very same UVW position. But I get these strange artefacts. Sometimes, the Sample() function just seems to return random values.
What I noticed:
1. If I - just for fun - call the sampled shader's InitRender() and FreeRender() functions in my Output function, instead of my InitRender and FreeRender (as I normally do), the artefacts get much worse.
2. It does not happen when I set Cinema's "Render Threads" to "1 (No MP)" in the preferences. So I guess it has something to do with multithreading.
3. Each time I render, the artefacts look a bit different. It really seems to be random.
4. If I only have one clone (so always the same UVW coordinate is used for sampling), no artefacts occur.
I hope somebody know more about this.
Greetings & a thousand thanks in advance,
Jack