Brace yourselves .. The deadliest jME3 changes since alpha are here

http://i.imgur.com/tZWts.jpg


Those have been laying for a while on my HD and I couldn't commit them due to many dependencies.
I'll put them in order of most significant to least significant:

  • Asset system was changed to support customizable caches and processors. Many keys and asset types were changed to use this new system. Several types of caches were added. What this means in the end is that the asset system is more manageable and more types of assets will be removed from the cache when instances become unreachable.


  • A shader validation system were added, so you can validate your shaders against NVIDIA Cg and GPU Shader Analyser tools (which must be in the PATH). This will indicate any warnings/errors with the shaders that are likely to appear on older GPUs or older drivers.


  • Added the new video playback system I was talking about. As mentioned in the change log, it DOESN'T support audio playback (you may have to do it separately, and manually dealing with sync issues etc). If there's anybody who wants to try and fix it, go ahead.


  • There's a new image format Depth24Stencil8, so now you can use the stencil buffer features with a framebuffer object instead of just with the main framebuffer.


  • Lots of deprecated stuff were removed. Methods, classes, materials, etc.


So yeah, that's the situation. If you encounter any trouble with the new changes, post here so we can find solutions.
15 Likes

Cool stuff.



Can you explain more about “A shader validation system” and how to use it?

LoL, +1 for the image alone. Winter… err I mean JME3 RC is coming ^^

sweeeeeett <33

OMG! Just checked the repo… So many changes! :smiley:



Kinda scared to update though… I wonder how much stuff will be broken on my side. :wink:

1 Like

Got an issue.



The addToCache(TextureKey, Texture) was removed and not deprecated from AssetManager, so I have no idea where to look for a replacement.



Help?

1 Like
@madjack said:
Got an issue.

The addToCache(TextureKey, Texture) was removed and not deprecated from AssetManager, so I have no idea where to look for a replacement.

Help?

I don't believe this method ever existed on AssetManager? But in any case, it shouldn't exist in the first place. The process for loading and handling assets now is much more complex so the ideal way is to expose the assets through AssetLocators and AssetLoaders rather than sneaking them in into the cache like that ...

@mifth said:
Cool stuff.

Can you explain more about "A shader validation system" and how to use it?

There are several parts to it. First you have to make sure you have either NVIDIA Cg Toolkit or GPU Shader Analyser installed (or both). Next, make sure they are in the PATH. Since you're a Linux user I assume you know what that means. On Windows you have to go to Computer Properties in Control Panel, then Advanced System Settings -> Environment Variables -> System Variables -> Path, and add the paths to the bin folder for each of the tools, separated by semi colon (;). Once you run jme3tools.shadercheck.ShaderCheck its going to go through all jME3 bundled shaders and run them through the tools you have installed. The log will contain info about which shaders passed or failed. Unsuprisingly, many of jME3's shaders fail the validation ....
@Momoko_Fan said:
I don't believe this method ever existed on AssetManager? But in any case, it shouldn't exist in the first place. The process for loading and handling assets now is much more complex so the ideal way is to expose the assets through AssetLocators and AssetLoaders rather than sneaking them in into the cache like that ...


Sorry, that isn't AssetManager itself. Rather it is:
[java]
((DesktopAssetManager) gMgrs.getAssetManager()).addToCache(textureKey, textureToCache);
[/java]

I'll look for a way around it.
1 Like

Epic picture is epic :stuck_out_tongue: … but I kind of scared to update too…

Found an issue.



The Lighting.j3md definition has a stray SimpleTextured.vert in Technique Glow. Replacing it to Unshaded.vert fixed the crash.



Found 2 more occurrences.



Particle.j3md

TerrainLighting.j3md

1 Like

greate work, thank you!



it is helpful to someone to get the shader test results (validation failure) for a single graphics card?

most common failure: error C7573: OpenGL/ES requires precision specifier on float types on a nvidia 8600m with latest driver!

@musterb said:
greate work, thank you!

it is helpful to someone to get the shader test results (validation failure) for a single graphics card?
most common failure: error C7573: OpenGL/ES requires precision specifier on float types on a nvidia 8600m with latest driver!

That's strange. Why is it compiling for GLSL ES? Did you change any of the settings?

@madjack: By the way, I returned the cache methods back into DesktopAssetManager, but I still recommend you reconsider using them.

@Momoko_Fan Thanks. I noticed and it’s working fine.



You have a suggestion on how I should achieve that with the new system? I’m using an offscreen-rendered texture that I’m adding to the cache so I can use it in a Nifty panel.



I will delve into that this week, but a pointer would accelerate things. :wink:

1 Like
@madjack said:
You have a suggestion on how I should achieve that with the new system? I'm using an offscreen-rendered texture that I'm adding to the cache so I can use it in a Nifty panel.

I will delve into that this week, but a pointer would accelerate things. ;)

I think I told you already. You need a locator and a loader. The locator defines which image you mean, idk how you would address them, maybe like "off_renderer/scenes/scene1.off" and delivers the stream from anywhere you want. The loader only needs to define the suffix and then pack the data into an image or texture. Then you access the texture using assetManager.loadImage("off_renderer/scenes/scene1.off"); and it will be cached.
1 Like

Hmm. I thought what you meant last time was that I’d have to “save on disk” so it can be retrieved from a hardcopy.



Alright then, I’ll fiddle with that tomorrow.



Thanks.

1 Like

You can create a RenderImageJme (nifty image) from a Texture2D. Did you try doing that?

@Momoko_Fan said:
You can create a RenderImageJme (nifty image) from a Texture2D. Did you try doing that?


Honestly I don't remember what I've tried. That was some time ago and didn't give it much thought after making it work.
1 Like

When the changes gonna be in JMP?

@KayTrance said:
When the changes gonna be in JMP?

When the direct AudioNode loading is reverted to loading AudioData again.

Sorry to slightly hijack this thread again…



So far I’ve made the locator and loader but after it’s been loaded TextureProcessor tries to cast the Texture to Image, which fails…



I’m guessing I’m doing something wrong here.



Here’s the trace.

[java]

java.lang.ClassCastException: com.jme3.texture.Texture2D cannot be cast to com.jme3.texture.Image

at com.jme3.texture.TextureProcessor.postProcess(TextureProcessor.java:12)

at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:298)

at com.jme3.asset.DesktopAssetManager.loadTexture(DesktopAssetManager.java:345)

at com.jme3.niftygui.RenderImageJme.<init>(RenderImageJme.java:56)

at com.jme3.niftygui.RenderDeviceJme.createImage(RenderDeviceJme.java:129)

[/java]

1 Like