glTF Export

gl Transmission Format, or glTF, is a free specification by KhronosGroup for the efficient transmission and loading of 3D scenes and models by applications which makes it great for RealTime Graphics. The Cinema 4D glTF Exporter exports the c4d scene to *.gltf/*.glb formats, ready to be used across all platforms supporting glTF.

Exporting Options

To Export the scene in glTF format go to File->Export->GLTF (*.gltf), select a destination and click Save. An Options window will pop up with the following options:

  • Export Normals: Deselect to get Flat Shading
  • Export UV Coordinates: Self explanatory
  • Export Textures: Self explanatory
  • Double Sided: Select to prevent Back-face Culling
  • Export TRS Animations: Export TRS animation tracks
  • Bake Animations: Bake every frame of animation
  • Substeps: Number of substeps to sample between each two frames
  • Flip Z: Switch from Left Handed to Right Handed System
  • Export as Binary(.glb): Export glTF file in its binary form

Materials

glTF takes the PBR approach to describe Materials, which translates pretty well to Cinema’s Reflection Channel, but is limited in some aspects. One of those is the lack for multilayered material support. And so, to get a similar looking result on export, we recommend working with a single Reflection/Specular layer in the Reflection Channel.


(*) Supported fields are Highlighted in blue

PBR Metallic Roughness

glTF’s PBR Material’s information is encoded into three main parameters:

  • Base Color: set by Layer Color’s Color selection or by Color selection in Color Channel.
  • Metallic Value: set by main reflection layer’s Reflection Strength value.
  • Roughness Value: set by main reflection layer’s Roughness value.

Texture maps to the aforementioned parameters are also supported:

  • Base Color Texture: set Bitmap Texture in Layer Color or in Color Channel.
  • Metallic Texture: set Grey-scale Bitmap Texture under Reflection Strength.
  • Roughness Texture: set Grey-scale Bitmap Texture under Roughness Strength.

Normal Map

Normal Maps can also be set in the main Reflection/Specular layer, under Bump Strength, set Mode to “Custom Normal Map” and set the Bitmap in Custom Texture.Can also be set in the Normal Channel and the Bump Channel.

Other Maps


(*) Supported fields are Highlighted in blue

Occlusion Map

Occlusion Map is set in the Diffusion Channel.

Emissive Factor and Map

Emissive Factor(Color) and Map are set in the Luminance Channel.

Alpha Map

Alpha Map is set in the Alpha Channel.

Notes and Limitations

  1. Reflection Strength vs. Metallic Value: Reflection Strength translates very closely to glTF’s Metallic Value, but there’s a difference… In Cinema 4D, Reflection Strength describes how much light is reflected off the surface, whereas Metallic Value describes how much the reflective behavior of the surface resembles that of a metal. 0% Reflection Strength means that the surface doesn’t reflect any light, meaning it’s black. But that is not true for 0% Metallic Value.
  2. Texture Baking: As of now, the automatic baking of Texture Shaders is not yet implemented. If you do use Shaders, please manually Bake them using the Bake Texture tag and re-set them as Bitmaps.
  3. Metallic-Roughness coupling: In glTF, the Metallic and Roughness Maps are actually single Bitmap where the values are incorporated into the Green and Blue Channels. So when setting a Reflection Strength and Roughness maps, please make sure they are the same dimensions. If they are not, then the Reflection Strength map will be scaled to match the Roughness map.
  4. Color-Alpha coupling: Same goes for the Color Texture and Alpha Map, as they will be merged into a single RGBA Bitmap.
  5. Mix Strength: glTF mixes between the Main Color and the Texture by component-wise multiplication of the RGB values. This required an adjustment method of the Color value or the Texture pixels at Export to achieve the same mix as in Cinema 4D. It’s still WIP and artifacts may appear in the result.
  6. Normal map strength: When setting the Normal map in the Reflection Channel… The strength, or “scale”, of the Normal Map is defined by the product of Bump Strength and Strength.
  7. Error Messages: Proper Error Descriptions are yet to be included, if you run into an error, it will most likely say “Out of Memory…” but it’s very rarely so.
  8. Polygon Selection: Polygon Selection is not yet supported, please manually Split the object and apply the different materials accordingly.
  9. Color properties priorities: If Color Channel is enabled, its properties override the Layer Color properties set in the Reflection Channel(i.e. Color, Brightness, Texture and Mix Strength)
  10. Normal map priorities: If Normal maps are set in the Reflection Channel, Normal Channel and Bump Channel. Then the Normal map and its Strength are retrieved from the Reflection Channel first, Normal Channel second, and Bump Channel last.
  11. Instances: not supported yet. instances will be baked into a new polygon object.
  12. Cubic Spline animation curves: in Cinema 4D, two coefficients define the tangent of every key: “value” and “time”. In glTF, a tangent is defined only by “value”. If your exported animation doesn’t look the same, consider baking the animation.
  13. Step curves: An animation property(Translation/Rotation/Scale) will be exported as Step Interpolation only if all its keys interpolations(in the x,y,z curves) are set to Step, otherwise it will be exported as Cubic Spline.

Installation

Simply unzip the downloaded archive into the plugins folder.

Requirements

Cinema 4D R20 and higher.

Download

Please rate this

30 Comments

  1. First of all, thank you for your work!

    Is there a roadmap or something like this?
    Will you be supporting extensions like Lights and Draco Compression?

    • Hi Viktor,
      no roadmap is planned but to follow the standard glTF 2.0 specification as best as possible 🙂

      Cheers,
      Basel

  2. Unfortunately, this doesn’t work at all when trying to load scenes in to Three.JS.

  3. Oh goodness, Thank you so much, its excelent working on C4D R20 , i expored object with PBR material and this is worked without any problems. I want to transit my project into a web site, due this plugin i can do this pretty simple!!!

    • Hi Iain,
      please double check:
      – You have Cinema 4D R20 or higher.
      – xlib/xdl64 and res folder together under /plugins folder of your Cinema4D(create one if missing).
      – Restart Cinema 4D and check File->Export: is the gltf option available?

      • Hi, Thanks for your quick reply. I am running C4D r20 and have created a plugins folder in program files/MAXON/Cinema 4D R20/

        I have restarted a number of times.

        Thanks

  4. Is it possible to have some kind of notification or be able to subscribe to a repo or something for updates to this?

  5. Oh yeah! The current export-pipeline via FBX and a Commandline-Convert-Tool was… let’s say… ineffective 😉
    Thanks a lot Basel for your work!

    Does anybody know when Maxon intends to add glTF import/export functionality right away?

  6. Awesome news! This means you can now create WebGL applications with Cinema 4D (possibly with Verge3D).

  7. Animation support including multiple animations is a must. GlTF supports this and I’ve previously managed to achieve this via takes > export to fbx > convert to gltf using fbx2gltf. Would be awesome to have this native though. Also +1 for import!!

  8. Hey, that‘s great news! Is an importer for gltf also planned? Would be great to work with sketchfab models without havimg to go through Blender etc.

  9. Fantastic work Basel! Much needed plugin (you saved us some gray hair)
    Plus one on animation
    many thanks
    Vertex Helix

Leave a Reply

Your email address will not be published. Required fields are marked *