Editor: defines in ShaderMaterial INFO tab are not exported when exporting a scene

Description of the problem

In the threejs.org/editor, when defining a shader material, there is an INFO tab with a defines and uniforms object. Items filled in in the defines object do not show up in the .json file when Export Scene is selected from the File menu.

For example, in the r84 editor, create a new scene. Add a plane. Change the material to ShaderMaterial. In the INFO tab, modify the code to read:

{
	"defines": {
		"TEST": "1.0"
	},
	"uniforms": {}
}

In the VERTEX tab, modify the code to read:

void main() {
	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, TEST );
}

Select File -> Export Scene. Open the .json file. Note that TEST only appears once. The subsequent scene does not render correctly when loaded, since the vertex shader fails to compile due to the missing definition of TEST.

Three.js version
  • Dev
  • r84
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • Linux
  • Android
  • IOS
Hardware Requirements (graphics card, VR Device, …)

Author: Fantashit

1 thought on “Editor: defines in ShaderMaterial INFO tab are not exported when exporting a scene

Comments are closed.