MeFisto94 / jme-discussion

This Repository is used to keep track of potential future feature additions to the jMonkeyEngine. Look at the Issues.
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

JSON Based Material System #1

Open MeFisto94 opened 4 years ago

MeFisto94 commented 4 years ago

There has been talk about using json for the material system instead of a "home-grown" special syntax, which is harder to parse, especially for tools, and in history, was error prone already due to false parsing.

riccardobl commented 4 years ago

IMO j3m and j3md should be merged into a single thing. And j3md should be able to extend other j3md (same fields in child will replace those in parent).

MeFisto94 commented 4 years ago

Well there is a difference between j3md and j3m. j3md is basically the shader and j3m the application of it. You can have multiple j3m for the same j3md. Also when desinging a j3md you design a shader/"material", but don't know who uses it.

Actually if something, j3md should be the material and j3m is just a convenience format to set the materials properties. It basically really only is that: a file format for an artist based workflow so you don't have to set textures in code.

riccardobl commented 4 years ago

If j3md can extend j3md, the j3m could just be a j3md that extends the base material and redefine only the needed values.

MeFisto94 commented 4 years ago

Actually I strongly think we should use yml over json, because:

e.g.

"textures": {
   "texture0": "path/to/img.jpg",
   "texture1":"path/to/img.png",
}

could be

textures:
  texture0: path/to/img.jpg
  texture1: path/to/img.png

Or with the array syntax:

"textures": [
  "a.png",
  "b.png"
],
textures:
  - a.png
  - b.png