Jump to content

[SOLVED] - No HDRCubeTexture Parsing


MackeyK24
 Share

Recommended Posts

If you specify texture customType = "BABYLON.HDRCubeTexture" and the other HDRCubeTexture properties... With .hdr as the

name... It will still try to use as regular CubeTexure and look for _px and _nx cube texture files:

I think babylon.texture.ts Parse function:

now is :

 if (parsedTexture.isCube) {
     return CubeTexture.Parse(parsedTexture, scene, rootUrl);
 }

and should be something like:

 if (parsedTexture.isCube) {
     if (parsedTexture.customType === "BABYLON.HDRCubeTexture")
        return HDRCubeTexture.Parse(parsedTexture, scene, rootUrl);
     else   
        return CubeTexture.Parse(parsedTexture, scene, rootUrl);
 }

OR IS THERE MORE to make HDRCubeTextures load from serialized .babylon file instead of only hand coding?

Link to comment
Share on other sites

Please can you fix... I am not that good with the whole Pull Request thing on github.

Also... I made a TON of fixes and enhancements to the unity exporter, but i don't know how to go about submitting them... There are code changes and little move arounds in pretty much all the exiting unity code plus i added a few more classes (some in same ExporterMetadata.cs and the rest in its own source file). So i don't know HOW clean the commits will look... It will be LARGE 'pink minus' and 'green plus' blocks, i imagine.

I was going to just zip the whole project up and post it... So the powers that be can download it take a look at all it new features... and if you think its worth it, ill upload to the github :)

 

Link to comment
Share on other sites

And just fyi, i do set more then just 'customType'. Here is my Unity HDRCubeTexture subclass:

	[DataContract]
	public class UnityBabylonHDRCubeTexture : UnityBabylonTexture
	{
		[DataMember]
		public string customType { get; private set; }

		[DataMember]
		public int size { get; set; }

		[DataMember]
		public bool useInGammaSpace { get; set; }

		[DataMember]
		public bool generateHarmonics { get; set; }

		[DataMember]
		public bool usePMREMGenerator { get; set; }

		[DataMember]
		public bool isBABYLONPreprocessed { get; set; }

		public UnityBabylonHDRCubeTexture()
		{
			this.customType = "BABYLON.HDRCubeTexture";
			this.size = 0;
			this.isCube = true;
			this.useInGammaSpace = false;
			this.generateHarmonics = true;
			this.usePMREMGenerator = false;
			this.isBABYLONPreprocessed = false;
		}
	}

 

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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