Originally posted by evilproducer at the DAZ3D forum here. Comments and questions should be posted there. Here we go:
First off, I’m not the one that came up with this method, and unfortunately, I don’t recall who did, as that information is lost in the pit of the Old Forums. If you posted about this in the past, then please step up and take a well deserved bow!
To create animated foam on the Ocean Primitive, you can use some basic shader functions in a creative way.
This is a medium scaled scene, so units of measure are based on that. Also, this is meant as a suggested method, not a definitive way to create foam. Scenes vary so this just outlines the steps I took and why.
The first thing I did was to load an Ocean primitive and change the size to 100 ft. I think you will find this looks better later on, when the ocean is replicated. For now, I would leave the wave height alone, unless you wish to increase it. A lower height wave may make it harder to find the right settings for the shader that will be created or modified.
The next step is to create the shader. You can modify the existing shader or create a new master shader. Personally, I found it easier to create a new master, and then work my way down, beginning at the Color channel.
In the Color channel, I added a color gradient and set the right side to white, and the left to a blue color. The white end of the gradient will be the foam. To drive the gradient, I chose to use Snow under Terrain Distribution. I then tweaked the coverage and noise, and lowered the noise scale to .02 ft. I then selected the Altitude tab and adjusted the settings, keeping an eye on preview window. Depending on the desired effect, the parameters will vary.
Next, I copied the snow distribution shader from the Color channel and pasted it in the bump channel.
I then added a color gradient in the Reflection channel, The gradient used black to the right, and white to the left. The reason for the black on the right, is because the foam isn’t really reflective, and black doesn’t reflect. To drive the gradient, I placed a Mixer, and in the top slot of the mixer, I left it empty, which for all intents and purposes is treated like pure black- meaning no reflections. I copied the snow shader from the color channel and pasted it into the second slot of the mixer. Remember, the gradient is reversed from the color channel with white (100% reflective) being the main body of the ocean, and the “foam” snow being black and not reflective. I placed a 1-100 value slider in the Mixer slot and adjusted the slider until I had the desired amount of reflection.
The Transparency channel also uses the reversed color gradient, but instead of pure white on the left, I placed a grey color. To drive the gradient, I again copied the Snow distribution shader from the Color channel and pasted it into the grey/black color gradient in the Transparency channel. The idea being that black is opaque, and by comparison, the foam is fairly opaque. The grey color on the other side of the gradient means the main body of water is not totally transparent. The grey color also means that it doesn’t add unwanted color to the water.
I did use Absorption and In-scattering. Check the settings out to see how it works:
To set up the ocean, I mentioned above that I changed it to 100 ft. The reason being is that I wanted to place it in a replicator, and the more area the ocean had, the less obvious it was being tiled.
So, at the top of the Menu Bar I chose Insert—> Replicator. I then selected the Replicator in the Instances Palette and clicked the wrench icon at the top right of the screen to open the Replicator editor. The first thing I did was to change the grid size in the X and Y coordinates to match the size of the ocean. After that, I enabled the Seamlessly checkbox in the lower left corner of the editor. In my scene, I left the replications at the defaults, but you can enter whatever value you want.
Now, the really cool thing about the oceans (and also terrains generated with the terrain editor), and why I enable the Seamlessly option, is that they tile seamlessly, which is pretty cool when you consider that the ocean primitive is animated.
Remember that the foam is animated by the changing height of the waves due to the elevation parameters of the Snow Distribution shader. The higher the wave goes, the more “foam” or snow it gets. As the wave lowers, the foam disappears.
An unofficial manual for the upcoming LuxusCore plugin for Carrara, that brings GPU accelerated rendering and realtime render preview into Carrara.
It is updated frequently, so check back often. If you have any questions or something to add, check the end of manual for links to the forum.
Table of Contents 1. What is LuxusCore? (Updated 2015-04-05) 2. Beta installation for Windows x64 only, free (Updated 2015-04-30): 3. First project and rendering 4. Shaders (Updated 2015-04-01)
5. Lights 6. FAQ (Updated 2015-04-30) 7. Example LuxusCore renders 8. Animation 9. Benchmarks 10. Settings to use in the Config Settings, until the UI is finished (Updated 2015-04-05) 11. Other
1. What is LuxusCore? LuxusCore is based in the LuxCore render engine of the upcoming Luxrender 2.0 (not released at the time of writing) and is a Carrara plugin with a built-in render engine.
LuxusCore supports GPU accelerated rendering and Interactive Photorealistic Rendering (IPR) inside Carrara.
It works on both AMD and NVIDIA graphics using the OpenCL language, so you need to have updated graphics drivers.
More about supported graphics cards can be found in the LuxCore wiki here.
Also runs on CPU, useful for laptops. Reported to be faster on CPU than the older LuxRender versions.
2. Beta installation for Windows x64 only free (Updated 2015-04-30):
Download from http://sphericlabs.com/preview/win64/LuxusCore.zip
It works until the end of the month*, at which point it must be updated or deleted, otherwise Carrara will not start the next month. *Updated 2015-04-30 to work until 2015-05-30.
Unzip to C:\Program Files\DAZ 3D\Carrara8.5\Extensions
Note 1: Path may be different if you installed Carrara elsewhere.
Note 2: LuxRender is not needed this time, unlike Luxus for Carrara. LuxusCore works both with a clean installation of Carrara and also if you already have the older Luxus plugin installed.
3. First project and rendering Start Carrara and load a default scene to quickly check that LuxusCore is working:
File -> Open Preset -> Global Illumination -> Skylight
Edit -> LuxCore IPR
Now the IPR render window should open and the realtime GPU preview rendering should be running.
The very first time you may get the same configuration dialog as when choosing Edit -> LuxCore Config
where you choose GPU or CPU rendering and the method for rendering. The screenshot shows the recommended settings for GPU acceleration, all graphics cards are selected, the CPU is not:
Now delete the default scene light and add a LuxusCore light: Insert -> LuxCore Sun-Sky. Uncheck “Do Sun” and to run the same type of scene as the preset, but using LuxCore setting instead.
In the Render Room, you can choose Rendering -> Renderer -> Photorealistic -> Luxcore via Luxus to get the full render options.
As you can see from the Render Room above, the native Carrara render on the left has a Glossy material. In the current version of LuxusCore this is not automatically translated.
A workaround is to build the shader as a new LuxusCore shader.
Glossy and Glass shaders for LuxusCore are available in SphericLabs simple test scene, get it here: http://sphericlabs.com/scratch/LuxusScene.zip
4.1 Transparency shader
Transparency with LuxusCore materials, for example eye-lashes:
> LuxCore Mix
>> LuxCore Null
>> LuxCore Matte or whatever material you desire
>> Amount is 0.0 for Null, 1.0 for Matte, or put a carrara texture map in there for something like eyelashes.
(You can swap the order of Null and Matte if you want 1.0 for fully transparent.)
4.2 Emission shader Should be as simple as turning up the power on the emissive channel, but here is a matte material that is emissive.
Its not very powerful, so if you have a sun in the scene, you might not be able to even see it emit light. http://sphericlabs.com/preview/Emissive.zip
4.3 Car paint shader The shader for the car below, used this shader:
> LuxCore Mix
>> LuxCore Car paint
>> LuxCore Mirror
>> Amount : 25
Joe Pingleton experimented using Lux mix shaders to combine the surface with a mirror so that he could adjust the reflections.
5. Lights Lights are available in the Insert menu, grouped with the other lights, currently available are LuxCore Infinite and LuxCore Sun-Sky.
LuxCore Infinite supports EXR’s, so you need to browse for them.
Carrara’s own spot, bulb, and distant lights are currently translated into LuxCore. Although it looks like it is not responding to changes during an IPR render. You will have to stop and start the render to reflect changes.
Mesh lights have to be done via the luxcore materials and work great. Make anything a LuxCore Matte material and turn up the power on the Emission channel. Here is a screenshot. As a heads up if you make a plane and make it emit, it will emit out of one side of the plane, not both.
Q: What are the latest changes/release notes?
-Glossy Translucent Material working
-Updated LuxCore to include improvements in last 2 months done by LuxCore developers. For example less memory usage for textures.
-Global shader should now work.
-Camera can roll and bank.
– Updated LuxCore
– Fixed a hang on close.
Q: What rendering engine is LuxusCore for Carrara running?
A: LuxusCore is using PATHOCL that can run on GPU or CPU. The Feb 2015 version also has: Light and Bidirectional for CPU rendering.
The available render engines in the full LuxCore: * LIGHTCPU: * PATHOCL: * PATHCPU: * BIDIRCPU: * BIDIRHYBRID: * CBIDIRHYBRID: * BIDIRVMCPU: * RTPATHOCL: * PATHHYBRID: * BIASPATHCPU: * BIASPATHOCL: * RTBIASPATHOCL:
Q: Does replicated replications work?
A: Yes, check the test render by SphericLabs below:
Q: What does the “bias” options do?
A: Check this Luxrender forum post for more details and renders.
Q: What Carrara shaders are translated into LuxCore shaders?
A: Translation of Carrara shaders is certainly limited. Right now it simply looks at the values of the standard multichanel shader and does a guess. It can certainly be improved. Also, internally saved textures will not work at all at this time.
Q: What are the known limitations/problems with LuxusCore?
A: Luxuscore plugin: Can’t use Carrara hair objects, plants objects or terrain shaders.
A2: Luxcore engine: Portals are not implemented.
Q: What happens if I use a graphics card with 2GB RAM and another with 4GB RAM?
A: Each graphics card needs its own copy of data to render. So if you have a 2GB card and a 4GB card, then you are limited to 2GB if you want to render with both.
Tip: Use only the 4GB for complex scenes with lots of textures. You can check memory consumption with GPU-Z from here.
Q: How do you set the camera? As in Exposure, White Balance, Depth of Field and Tone Mapping.
A: It can be done via the config settings, DOF would be via the scene settings. It will be exposed in a nice UI later.
Q: There is a graphics glitch, what can I try to change that may help?
A1: Try the CPU renderer that is supposed to be more stable first. In the Edit/LuxusCore Config, select CPU/Path, if that still fails, try CPU/Bidir for complex scenes (interiors). More info about the settings is available in the LuxRender wiki here.
A2: LuxCore uses accelerators, these speed up ray casting and figuring out what rays hit and where. The default is for LuxCore to choose the accelerator:
accelerator.type = AUTO
Try these in the config settings: accelerator.type = BVH accelerator.type = MBVH accelerator.type = QBVH accelerator.type = MQBVH More about accelerators in the Luxrender FAQ.
Q: What can I do if I run out of GPU memory?
A: You can try to consolidate shaders. For example a 2600MB scene can be cut down to 1800MB just by doing this.
Also close any open web browsers to free about 100-300MB of GPU memory.
7. Example LuxusCore renders
In The Shadows by Joe Pingleton
The Opening of Eyes – by Joe Pingleton
Nicole by Joe Pingleton
This was rendered in 2 minutes with only one infinite light and no messing around with the default shaders.
One of the major benefits of LuxusCore and LuxCore, is the possiblity to render high quality animation quickly on a desktop with a fast graphics card or four.
Right now, the good news is that animation rendering works, the bad news is that you need to manually write the settings (while an UI is being developed).
In the Render Room, enter this data in the Config Settings box, to get an animation of 25 seconds or rendertime per frame and using the SOBOL sampler for faster rendering: batch.halttime = 25 sampler.type = SOBOL
If you are running a simple scene on a powerful desktop (or want higher quality), like SpericLabs scene with a translation of the box on multiple graphics cards, try these settings for 256 samples per pixel and the better Metropolis sampler: batch.haltspp = 256 sampler.type = METROPOLIS
The first frame does show some more details, like the number of samples, which is useful the guess the render time, at least 100 samples is a good starting point.
Both rendering to AVI with uncompressed frames and Sequenced PNG files works. Rendering progress is visible, both the rendered frame is seen and the frame counter is visible.
8.1 About Samplers
-Sobol is better than Metropolis when it comes to rather simple lighting, like outdoor sunlight.
-Sobol is “dumber and faster” than Metropolis.
-Metropolis is better in more complex lighting situations (caustics through glass, light through a small window etc.). It is the default sampler for LuxCore.
-More about samplers at the Luxrender wiki.
LuxusCore Carrara Animation Test 04 by Joe Pingleton:
Benchmarks are useful to check if your rig is setup to run properly.
Test scene: 1. SphericLabs simple test scene, get it here: http://sphericlabs.com/scratch/LuxusScene.zip.
Default resolution 640×480 in Render Room. Settings: OpenCL/path/unbiased Results:
CPU Core-17-2700k@4,7GHz (overclocked): 2,0 Ms/s
GPU AMD Radeon 7970 (stock): 8,35Ms/s
GPU AMD Radeon 7970 x3 (stock): 25,0Ms/s (perfect scaling, exactly 3x faster)
GPU NVIDIA GTX970 (stock) 8-9Ms/s
10. Settings to use in the Config Settings, until the UI is finished Some basic settings to help speed up rendering / IPR (thanks to Steve).
10.1 These are for PathOCL.
The settings are entered in the “render room > Luxcore via Luxus > Config Settings”
renderengine.type = “PATHOCL” (sets renderer to PathOCL) path.maxdepth = 3 (sets mamimum path depth. A value of 1 will give direct lighting only. I set to 3 for IPR, and set to 4 (or possibly more, depending on scene) for final render) path.clamping.radiance.maxvalue = 10 (clamping radiance, helps prevent fireflys. Good for indoor scenes, but can cause greyed out image if applied on outside well lit scenes if set as a low value). For indoor scenes, I usually set to 10 (as shown) and adjust as needed.) path.clamping.pdf.value = 0 (This works in oposite to radiance clamping, and will clamp low levels. Good to help prevent noisy shadows, but better set to low value, of as example, 0.1 – 0.5. If set too high, image will be black in many areas.) film.filter.type = “NONE” (if filtering set to “NONE”, rendering will be quicker. Other types are: “GAUSSIAN”, “BOX”, “MITCHELL_SS”, “MITCHELL” and “BLACKMAN-HARRIS” film.filter.width = 2 (value to set for filtering when it is not set to NONE)
10.2 Some settings for BiaspathOCL.
renderengine.type = “BIASPATHOCL” (set to BiaspathOCL) tile.size = 32 (Biaspath renders in buckets/tiles. This setting sets the tiles size. In earlier builds of Luxcore, the size of the tiles could affect render times. That, it as been stated, does not now matter. During testing I have found that making tile size smaller can cause a crash, and making tile size bigger can use a lot more graphics card memory. So would suggest leaving that setting at 32 for now). tile.multipass.enable = 1 (enables (set to “1”) multipass rendering. If set to “0” only one pass made.) tile.multipass.convergencetest.threshold = 0.04 (controls quality of render. Lower values give better quality(less noise). Default = 0.04, which for well lit scenes is probably OK. For scenes with lots of shadows or indoor scenes, it will probably need setting lower. I set usually between 0.1 – 0.2 for final renders. Render will stop when threshold reached) biaspath.sampling.aa.size = 3 (Scene total max aa sampling)
Sampling for materials can be set separately for “diffuse”, “glossy” and “specular”. These settings are for scene defaults:- biaspath.sampling.diffuse.size = 2
biaspath.sampling.glossy.size = 2
biaspath.sampling.specular.size = 1
biaspath.pathdepth.total = 10 (Scene total max path depth)
Path depth is also set separately for “diffuse”, “glossy” and “specular” These settings are for scene defaults:- biaspath.pathdepth.diffuse = 2
biaspath.pathdepth.glossy = 1
biaspath.pathdepth.specular = 2
Note: Path depth default for diffuse is set to “2”. That currently is insufficient to give good indirect lighting(certainly for indoor scenes). I suggest it should be set to at least 3: = biaspath.pathdepth.diffuse = 3)
Clamping can also be set as shown/explained in above post: biaspath.clamping.radiance.maxvalue = 0
biaspath.clamping.pdf.value = 0
10.3 Realtime settings If you are interested in using the realtime LuxCore stuff you can try: