Cascaded shadow maps!

As far as I know there was no CSM implementation for three js since 2015 (correct me if I’m wrong) but I just found this demo, and so I implemented it in my project.

If anyone needed CSM for their project, check out vtHawk’s three-csm:


This looks really nice!

I wasn’t aware CSM had ever been in three.js. Searching around (if others are curious) revealed this thread on the topic.

I’m surprised by how little configuration CSM requires. Or relatively little, I did see you had to contribute a custom split option to get there. Set up the cascade splits, and near/far planes, and the rest is derived from the camera frustum? Very clean. :slight_smile:


Yes I agree! Right now it’s a separate “experimental” plugin and requires bunch of shenanigans to get working. It’d be nice to have it in three.js core.

There’s the famous road demo using CSM from 2013 running on r48.

Then, in r69, CSM stopped working, and so was officially removed in 2015, because “no one was maintaining, nor understanding, the old code”.


Glad to see 5 years later other people arise who share my view :smiley:

Sarcasm aside, I still think it’s the best shadowing solution for threejs before we get RTX on webgl or some such


i have a question,how did you build the level ?

1 Like

In Blender. In addition to geometry and materials, I have collisions, spawn points, paths, etc. all defined in Blender using custom properties.


do you have tutorial how can i create in blender that list of properties ?

I haven’t followed any tutorials. It’s pretty simple as far as I’m concerned.

In the object’s custom properties, fill in any data you want. Here I have two keys:

  1. data = physics
  2. type = trimesh

When exporting gltf, check Custom properties:

Then once you load your gltf, access your data via userData:

	if (child.hasOwnProperty('userData')) {
		if (child.userData.hasOwnProperty('data')) {
			if ( === 'physics') {
				if (child.userData.type === 'trimesh')
					// Create trimesh physics object from child

I’m sure if you google “three.js gltf custom properties” there’ll be links to more detailed tutorials and guides…


thank you very much !

1 Like

It all highly depends on what specifically you want to do with the object in your application…

The name doesn’t matter. ‘trimesh’ is just my attribute that I use.

You can have ‘applyPhysics’ = 1 or ‘fruit’ = ‘banana’. The names don’t do anything on their own, they’re just strings or numbers attached to the object, nothing else. It’ll be whatever you find the most convenient, and then you need to parse and use the data in your application. It all depends on what specifically do you want to do.

Why do you need to use custom attributes? How specifically do you use them? What application are you working with?

Edit: Object names are also irrelevant and don’t do anything in the context of gltf export / import.

1 Like

if( === “Ground”){

  let ground = new THREE.Mesh(meshes.geometry, meshes.material);

  ground.parent = meshes.parent;

  ground.children = meshes.children;



  ground.castShadow = false;

  ground.receiveShadow = true;

  scene.add( ground );



is it correct to add parent and children, or i do need to loop ?

What are you trying to do?

I can’t help you because I don’t know what you are trying to do.

i want build static ground with some static objects and walk around that scene

something like you did or maybe

hey ,i applied material reflection in Blender

and when i loaded to Three.js it looks like this but in blender it is different

how can i fix this issue ? you can see my code in

@extremety1989 you may want to create a new issue topic for your topic/questions. :slight_smile:


i already solved it, but i will create one, with how to set cannon.js with blender shapes :smiley: