Jump to content

BJS Editor embedded textures


Recommended Posts

Hi everybody:

We're trying to use the BJS Editor in order to have PBR materials, as the Exporter (from Blender) doesn´t let use them.

Our problem is that the resulting .babylon file generated by BJS Editor seems to include the textures as embedded ("base64String" property), resulting so in a huge .babylon file.

In parallel, a clever reusing of textures (as .dds) is not possible, as they are all embedded time after time, with each scene.

Is there any alternative to this workflow?

Thanks for your time.

Best regards.


Addendum (real .babylon file excerpt):

. . .
  "tags": "added",
  "directIntensity": 1,
  "emissiveIntensity": 1,
  "environmentIntensity": 1,
  "specularIntensity": 1,
  "disableBumpMap": false,
  "albedoTexture": {
	"tags": null,
	"url": "tubo_basecolor.png",
	"uOffset": 0,
	"vOffset": 0,
	"uScale": 1,
	"vScale": 1,
	"uAng": 0,
	"vAng": 0,
	"wAng": 0,
	"isBlocking": true,
	"name": "tubo_basecolor.png",
	"hasAlpha": false,
	"getAlphaFromRGB": false,
	"level": 1,
	"coordinatesIndex": 0,
	"coordinatesMode": 0,
	"wrapU": 1,
	"wrapV": 1,
	"anisotropicFilteringLevel": 4,
	"isCube": false,
	"gammaSpace": true,
	"invertZ": false,
	"lodLevelInAlpha": false,
	"lodGenerationOffset": 0,
	"lodGenerationScale": 0.8,
	"isRenderTarget": false,
        "animations": [],
. . .


Link to comment
Share on other sites

A couple of things, around the edges:

  • You could use the glTF exporter for Blender.  I am not sure how efficient that is to the .babylon exporter, but believe is handles PBR.
  • Also, since a JSON file is ascii, it can be gzipped by the server, so the result is not as bad as it might seem.
  • I really do not know enough (anything really) about PBR, let alone on both sides to add this to Blender exporter.  It is also not really important for me.  Without a very simple .blend using PBR (hopefully not in Cycles), it will never get put in the Blender exporter by me.  No specs, no export.
  • Have not really used this editor, but if it runs does NOT run in a browser, then there may be an option somewhere to save separate files.  Browsers cannot really save files directly.  They fake download them.  Doing that many times could be a pain.
Link to comment
Share on other sites

Hi there and thank you for your suggestions;

Our main issue is that we don't want to export a blender's PBR shader. Instead, we want to be able to create the BabylonJS PBR shader inside blender. I am the "3D guy" here but I guess it would be fairly simple to just put a tab in the properties of an object with the babylon material (it doesn't matter which one) and be able to put there the one we want, in our case, the PBR one. And then, make the exporter write that info into the babylon file.

Here you can see the maths behind PBR materials in Blender. But, as I said, that is not what we need. We don't need to create a Blender material but a babylon one.

Thanks in advance and thanks for your exporter.

Link to comment
Share on other sites

Just putting up a section in the materials properties tab actually means not having to care what Blender's implementation is.  Would also give superior results as opposed to mapping what Blender supports into what BJS has.  Somekind of common denominator.  Will not be rendered in Blender though.

Someone could go thru as many serialized properties as possible, and turn them into property definitions like:

bpy.types.Material.directIntensity = bpy.props.FloatProperty(
    name='Direct Intensity',
    description='Intensity of the direct lights e.g. the four lights available in your scene.\nThis impacts both the direct diffuse and specular highlights.',
    default = 1.0, min = 0, max = 1

Those which are int are bpy.props.IntProperty.  Strings are bpy.props.StringProperty.  Booleans are bpy.props.BoolProperty.  I see no reason why I should do this, though it also does not have to specifically be you.

User interface and extraction of properties into the python export code is based on these definitions.

I see there are also sub-types of PBR like: simple, glossy, & roughness.  One thing UI wise I am recently capable of is Tabs.  Here is how I can export a mesh as faces, or vertices(Hair).  Could possibly organize tabs with properties specific to simple, glossy, & roughness the same way.



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...