Shader Showcase Game Jam

Post your ideas, contributions, pictures and progress on this project here.

Here’s my challenge for you:

GUI:

Usually the rectangular healthbar fills from left to right, while the circle healthbar fills clockwise and the background color is usually a darker version of the primary color.

Write your version of the shaders I have proposed or add others to the list.
Feel free to express your creativity, create your own project and publish it on github. I will help you with testing and fine-tuning the code. I would like to create a shader development lab for jme. The only rules are: do it the way you want, share it, and help the community grow and learn.

Anyone who wants to take up the challenge is free to join.

10 Likes

Here’s a hologram/scanner effect.

I’ve uploaded the code to this repository.

The shader is animated, but the only videos I am able to get are super poor quality. You can get a video from here if you really want to watch it.

11 Likes

Good work @codex . I am preparing a project that contains a bit of useful functions to easily build test cases for these shaders. I will make it public on github soon. I will also add an animated model from Mixamo to test shaders on skeleton models.

6 Likes

Here are some of the shader effects that I have (partially) implemented in my game so far.

Here is a simple dissolve effect. Its not quite as pronounced as the unity one and doesn’t have bright-edges on the dissolving area, and all of the options that should be configurable are hard-coded into the shader. But I will work on trying to improve those things when I extract it into its own .glslib file prior to uploading to your repo:

And here is a lightning effect that I shared a gif from a long time ago when I was learning how to use noise. When comparing to the unity one, It appears I didn’t make the colors saturated or bright / glowy enough, but I will try to take some insight from the unity shader you posted and see how close I can get. I also generate the noise with code, but I think there could be some optimization-benefit to adapting it so a noise texture can be used, especially on mobile devices where calculating noise in-shader might eat up too many resources:

Imgur
https://i.imgur.com/OsGcKzi.gif

I unfortuantely can’t show the stone petrify effect that turns the stag into a statue, because that is hard-coded on a statue model that is located on a map in my game that is currently broken :upside_down_face: But I will also work on that (along with the ice, ghost, and potentially the body-sheild effect) and hopefully have something ready for those soon. I think those 4 effects could all be packed into one .glslib since they all are based on applying a tri-planar mapped wrappable texture (or a unique pre-prepared texture atlas) to the model along with some fancy effects.

And lastly, I do have 2 different rectangular healthbar shaders, one old one that you can see in my first video overtop of the Stag’s head, and another one I use on the GUINode.

And while I don’t have a circular healthbar, I do have this spiral-cooldown shader that’s useful for square ability buttons that I can upload, and the code in this shader can be adapted to make a circular healthbar like the one in Unity, it would just require a color ID map to indicate what parts are filled. So i’ll try to do that as well and see if I can upload that too.


Once I’ve extracted all of the effects from my own hard-coded shaders, I will put them into .glslib files and incorporate them into your shader-project. The test-cases that you mentioned should also make it easier for me to fix/enhance a few things before merging to your repo, and then you (or anyone else that is interested) can try to improve or tweak any of my effects from there :slightly_smiling_face:

13 Likes

Great @yaRnMcDonuts , your shaders are very interesting. Extract them from the project and post them to your repository so I can rework them and help you add details and configuration parameters.

@codex I have reworked the test code you posted. I’ll add a few things and upload it to github. Here are some screenshots:

Edit:

11 Likes

This is somewhat related, so I’ll post this here.

I threw together a shader creation wizard in the past couple days, since I got annoyed with writing matdef files that are almost the same.

I’ve uploaded a jar file here if anyone wants to give it a try.

10 Likes

What a neat idea!

2 Likes

Hi @codex , great idea! I will try it out.

Here is another useful tool for changing Material parameters at runtime that I wrote with Lemur. It can be quickly modified to add new features. Have a look at it and let me know if it is useful for testing shaders. Here is a video showing how it works. For those who want to use the SDK instead, there are some helpful guidelines at the end of the video.
Soon I will provide more useful tools and animated models with and without textures for further testing.

Source code here: jme-shader-pack

10 Likes

I look forward to this! That will make it much easier for me to clean things up and test my shaders after refactoring into .glsllibs, that way I don’t end up handing off as much broken code to you as I would if I were testing things in my game.

In the meantime, to prepare for extracting my shaders into modular .glsllibs, I have finally addressed this issue: Refactor shaders to utilize shared .glslibs between multiple rendering engines · Issue #2122 · jMonkeyEngine/jmonkeyengine · GitHub

And I have heavily refactored PBRLighting.frag so that it will be much easier to add effects like ice or petrfiy from a modular .glslib file without worrying about updating the shader everytime someone adds something new to PBRLighting on master.

PBRLighting.frag has gone from ~400 lines of code down to ~ 80, and I even added some extra debug functionality in the process. Hopefully this will help to make these shader effects much more accessible and easy for jme devs to add to their own forks of PBRLighting going forward.

6 Likes

It is amazing how many new ideas come from working together. Actually, the main shader and .glsllibs libraries need some love to make them easier to use. Well done @yaRnMcDonuts . I will let you know when the models are ready.

Edit:
@codex @yaRnMcDonuts
Models uploaded here:

4 Likes

I tried to import the jme-shader-pack-main project into the SDK, however I am getting this error preventing me from priming the build and running it:

JAVA_HOME="C:\Program Files\jmonkeyplatform_3.6.1-stable\jdk"
cd C:\Users\ryan\Desktop\JM\jme-shader-pack-main; .\gradlew.bat --configure-on-demand clean build

FAILURE: Build failed with an exception.

* Where:
Settings file 'C:\Users\ryan\Desktop\JM\jme-shader-pack-main\settings.gradle'

* What went wrong:
Could not compile settings file 'C:\Users\ryan\Desktop\JM\jme-shader-pack-main\settings.gradle'.
> startup failed:
  General error during semantic analysis: Unsupported class file major version 61
  
  java.lang.IllegalArgumentException: Unsupported class file major version 61
  	at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:196)
  	at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:177)
  	at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:163)
  	at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:284)
  	at org.codehaus.groovy.ast.decompiled.AsmDecompiler.parseClass(AsmDecompiler.java:81)
  	at org.codehaus.groovy.control.ClassNodeResolver.findDecompiled(ClassNodeResolver.java:251)
  	at org.codehaus.groovy.control.ClassNodeResolver.tryAsLoaderClassOrScript(ClassNodeResolver.java:189)
  	at org.codehaus.groovy.control.ClassNodeResolver.findClassNode(ClassNodeResolver.java:169)
  	at org.codehaus.groovy.control.ClassNodeResolver.resolveName(ClassNodeResolver.java:125)
  	at org.codehaus.groovy.ast.decompiled.AsmReferenceResolver.resolveClassNullable(AsmReferenceResolver.java:57)
  	at org.codehaus.groovy.ast.decompiled.AsmReferenceResolver.resolveClass(AsmReferenceResolver.java:44)
  	at org.codehaus.groovy.ast.decompiled.AsmReferenceResolver.resolveNonArrayType(AsmReferenceResolver.java:79)
  	at org.codehaus.groovy.ast.decompiled.AsmReferenceResolver.resolveType(AsmReferenceResolver.java:70)
  	at org.codehaus.groovy.ast.decompiled.MemberSignatureParser.createMethodNode(MemberSignatureParser.java:57)
  	at org.codehaus.groovy.ast.decompiled.DecompiledClassNode$2.get(DecompiledClassNode.java:234)
  	at org.codehaus.groovy.ast.decompiled.DecompiledClassNode$2.get(DecompiledClassNode.java:231)
  	at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.createMethodNode(DecompiledClassNode.java:242)
  	at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.lazyInitMembers(DecompiledClassNode.java:199)
  	at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.getDeclaredMethods(DecompiledClassNode.java:122)
  	at org.codehaus.groovy.ast.ClassNode.getMethods(ClassNode.java:912)
  	at org.codehaus.groovy.ast.ClassNode.tryFindPossibleMethod(ClassNode.java:1280)
  	at org.codehaus.groovy.control.StaticImportVisitor.transformMethodCallExpression(StaticImportVisitor.java:252)
  	at org.codehaus.groovy.control.StaticImportVisitor.transform(StaticImportVisitor.java:113)
  	at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitExpressionStatement(ClassCodeExpressionTransformer.java:142)
  	at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:40)
  	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:110)
  	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:121)
  	at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitConstructorOrMethod(ClassCodeExpressionTransformer.java:53)
  	at org.codehaus.groovy.control.StaticImportVisitor.visitConstructorOrMethod(StaticImportVisitor.java:89)
  	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructor(ClassCodeVisitorSupport.java:128)
  	at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1099)
  	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:54)
  	at org.codehaus.groovy.control.StaticImportVisitor.visitClass(StaticImportVisitor.java:83)
  	at org.codehaus.groovy.control.CompilationUnit$14.call(CompilationUnit.java:708)
  	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1084)
  	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:640)
  	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:618)
  	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:595)
  	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:401)
  	at groovy.lang.GroovyClassLoader.access$300(GroovyClassLoader.java:89)
  	at groovy.lang.GroovyClassLoader$5.provide(GroovyClassLoader.java:341)
  	at groovy.lang.GroovyClassLoader$5.provide(GroovyClassLoader.java:338)
  	at org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache.getAndPut(ConcurrentCommonCache.java:147)
  	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:336)
  	at org.gradle.groovy.scripts.internal.DefaultScriptCompilationHandler.compileScript(DefaultScriptCompilationHandler.java:139)
  	at org.gradle.groovy.scripts.internal.DefaultScriptCompilationHandler.compileToDir(DefaultScriptCompilationHandler.java:95)
  	at org.gradle.groovy.scripts.internal.BuildOperationBackedScriptCompilationHandler$2.run(BuildOperationBackedScriptCompilationHandler.java:54)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:395)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:387)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:157)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:242)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:150)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:84)
  	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
  	at org.gradle.groovy.scripts.internal.BuildOperationBackedScriptCompilationHandler.compileToDir(BuildOperationBackedScriptCompilationHandler.java:51)
  	at org.gradle.groovy.scripts.internal.FileCacheBackedScriptClassCompiler$CompileToCrossBuildCacheAction.execute(FileCacheBackedScriptClassCompiler.java:190)
  	at org.gradle.groovy.scripts.internal.FileCacheBackedScriptClassCompiler$CompileToCrossBuildCacheAction.execute(FileCacheBackedScriptClassCompiler.java:170)
  	at org.gradle.groovy.scripts.internal.FileCacheBackedScriptClassCompiler$ProgressReportingInitializer.execute(FileCacheBackedScriptClassCompiler.java:211)
  	at org.gradle.groovy.scripts.internal.FileCacheBackedScriptClassCompiler$ProgressReportingInitializer.execute(FileCacheBackedScriptClassCompiler.java:194)
  	at org.gradle.cache.internal.DefaultPersistentDirectoryCache$Initializer.initialize(DefaultPersistentDirectoryCache.java:100)
  	at org.gradle.cache.internal.FixedSharedModeCrossProcessCacheAccess$1.run(FixedSharedModeCrossProcessCacheAccess.java:86)
  	at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.doWriteAction(DefaultFileLockManager.java:215)
  	at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.writeFile(DefaultFileLockManager.java:205)
  	at org.gradle.cache.internal.FixedSharedModeCrossProcessCacheAccess.open(FixedSharedModeCrossProcessCacheAccess.java:83)
  	at org.gradle.cache.internal.DefaultCacheAccess.open(DefaultCacheAccess.java:139)
  	at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:78)
  	at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:42)
  	at org.gradle.cache.internal.DefaultCacheFactory.doOpen(DefaultCacheFactory.java:95)
  	at org.gradle.cache.internal.DefaultCacheFactory.open(DefaultCacheFactory.java:68)
  	at org.gradle.cache.internal.DefaultCacheRepository$PersistentCacheBuilder.open(DefaultCacheRepository.java:126)
  	at org.gradle.groovy.scripts.internal.FileCacheBackedScriptClassCompiler.compile(FileCacheBackedScriptClassCompiler.java:116)
  	at org.gradle.groovy.scripts.internal.CrossBuildInMemoryCachingScriptClassCache.getOrCompile(CrossBuildInMemoryCachingScriptClassCache.java:50)
  	at org.gradle.groovy.scripts.internal.BuildScopeInMemoryCachingScriptClassCompiler.compile(BuildScopeInMemoryCachingScriptClassCompiler.java:50)
  	at org.gradle.groovy.scripts.DefaultScriptCompilerFactory$ScriptCompilerImpl.compile(DefaultScriptCompilerFactory.java:49)
  	at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:125)
  	at org.gradle.configuration.BuildOperationScriptPlugin$1.run(BuildOperationScriptPlugin.java:65)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:395)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:387)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:157)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:242)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:150)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:84)
  	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
  	at org.gradle.configuration.BuildOperationScriptPlugin.lambda$apply$0(BuildOperationScriptPlugin.java:62)
  	at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.apply(DefaultUserCodeApplicationContext.java:43)
  	at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:62)
  	at org.gradle.initialization.ScriptEvaluatingSettingsProcessor.applySettingsScript(ScriptEvaluatingSettingsProcessor.java:74)
  	at org.gradle.initialization.ScriptEvaluatingSettingsProcessor.process(ScriptEvaluatingSettingsProcessor.java:67)
  	at org.gradle.initialization.SettingsEvaluatedCallbackFiringSettingsProcessor.process(SettingsEvaluatedCallbackFiringSettingsProcessor.java:34)
  	at org.gradle.initialization.RootBuildCacheControllerSettingsProcessor.process(RootBuildCacheControllerSettingsProcessor.java:36)
  	at org.gradle.initialization.BuildOperationSettingsProcessor$2.call(BuildOperationSettingsProcessor.java:50)
  	at org.gradle.initialization.BuildOperationSettingsProcessor$2.call(BuildOperationSettingsProcessor.java:47)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:409)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:399)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:157)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:242)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:150)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:94)
  	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
  	at org.gradle.initialization.BuildOperationSettingsProcessor.process(BuildOperationSettingsProcessor.java:47)
  	at org.gradle.initialization.DefaultSettingsLoader.findSettingsAndLoadIfAppropriate(DefaultSettingsLoader.java:120)
  	at org.gradle.initialization.DefaultSettingsLoader.findAndLoadSettings(DefaultSettingsLoader.java:58)
  	at org.gradle.initialization.SettingsAttachingSettingsLoader.findAndLoadSettings(SettingsAttachingSettingsLoader.java:35)
  	at org.gradle.internal.composite.CommandLineIncludedBuildSettingsLoader.findAndLoadSettings(CommandLineIncludedBuildSettingsLoader.java:34)
  	at org.gradle.internal.composite.ChildBuildRegisteringSettingsLoader.findAndLoadSettings(ChildBuildRegisteringSettingsLoader.java:52)
  	at org.gradle.internal.composite.CompositeBuildSettingsLoader.findAndLoadSettings(CompositeBuildSettingsLoader.java:35)
  	at org.gradle.initialization.DefaultSettingsPreparer.prepareSettings(DefaultSettingsPreparer.java:36)
  	at org.gradle.initialization.BuildOperatingFiringSettingsPreparer$LoadBuild.doLoadBuild(BuildOperatingFiringSettingsPreparer.java:59)
  	at org.gradle.initialization.BuildOperatingFiringSettingsPreparer$LoadBuild.run(BuildOperatingFiringSettingsPreparer.java:54)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:395)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:387)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:157)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:242)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:150)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:84)
  	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
  	at org.gradle.initialization.BuildOperatingFiringSettingsPreparer.prepareSettings(BuildOperatingFiringSettingsPreparer.java:42)
  	at org.gradle.initialization.DefaultGradleLauncher.prepareSettings(DefaultGradleLauncher.java:225)
  	at org.gradle.initialization.DefaultGradleLauncher.doClassicBuildStages(DefaultGradleLauncher.java:166)
  	at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:155)
  	at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:131)
  	at org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:72)
  	at org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:67)
  	at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:180)
  	at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:40)
  	at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:67)
  	at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:56)
  	at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:54)
  	at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
  	at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
  	at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:63)
  	at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
  	at org.gradle.tooling.internal.provider.FileSystemWatchingBuildActionRunner.run(FileSystemWatchingBuildActionRunner.java:52)
  	at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:41)
  	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:49)
  	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:44)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:409)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:399)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:157)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:242)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:150)
  	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:94)
  	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
  	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:44)
  	at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:50)
  	at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:47)
  	at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:87)
  	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:47)
  	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:31)
  	at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:44)
  	at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:29)
  	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:87)
  	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:55)
  	at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:60)
  	at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:38)
  	at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:68)
  	at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:38)
  	at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:37)
  	at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:26)
  	at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:60)
  	at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:32)
  	at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:56)
  	at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:42)
  	at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:48)
  	at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:32)
  	at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:68)
  	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
  	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
  	at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:39)
  	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
  	at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:29)
  	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
  	at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:35)
  	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
  	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:78)
  	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:75)
  	at org.gradle.util.Swapper.swap(Swapper.java:38)
  	at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:75)
  	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
  	at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
  	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
  	at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:63)
  	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
  	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
  	at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
  	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
  	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
  	at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52)
  	at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
  	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
  	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
  	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
  	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
  	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
  	at java.base/java.lang.Thread.run(Thread.java:833)
  

And when I open the “resolve problems” dialog, it gives the following issue saying that java 17 is not supported and to use 14 or lower, however your project does indeed indicate to use Java 11 in the gradle build, so im unsur why its saying its trying to use 17:

The Java version: 17, that is seletced for the project is not supported by Gradle 6.6.The IDE will attempt to use Gradle 8.1 to gather the project information.
Possible solutions:
Upgrade your Gradle version on your project
Select Java Runtime 14 (or below), on Build > Gradle Execution settings, to avoid this problem!

Any ideas what could be wrong here?

In the meantime, I’ve copy/pasted the code to a new SDK gradle project so I can start working with it locally, but I think I should probably resolve this error before trying to upload my shaders and examples so its easier to merge with your repo.

You need Java 17 to run that. That is what the error message is saying. The second error message is saying you should use newer Gradle that actually supports Java 17.

What I recommend is using Gradle wrapper and setting it up in the build.gradle. Select a Gradle version that is up to the task and define it in the wrapper.

With Netbeans, you can also select from the settings the Gradle policy to use. But I recommend the wrapper approach for IDE (& IDE version) neutral approach.

Edit: ok, I looked at the project, this is not your project I assume. It didn’t have the Gradle wrapper setup and it had Java 11 set (although I have not used this approach so I don’t even know what Gradle version this is from). So your best bet is to just tweak your IDE Gradle policy locally. You should find this Options → Java → Gradle in the SDK/NB.

1 Like

OpenKeeper has example on the Gradle wrapper setup. Also it has OpenKeeper/assets/Shaders/UnitFlower.frag at master · tonihele/OpenKeeper · GitHub this is basically a Circle Healthbar with a twist. I guess it might be useful example to start making a simple general one.

2 Likes

Right before you made this edit, I went in and copy/pasted the “gradle” and “.gradle” folders from a new SDK project and pasted them into the jme-shader-pack-main project, replacing the other gradle version/wrapper with the one the SDK generates.

This seemed to fix the issue and I think that made it so it uses a gradle wrapper now, is that a good solution? Or should I still change anything in the gradle policy?

Well if it works… I wouldn’t touch then. But I advice the project manager, or as it is a open source effort anyone really, to make a PR to add the wrapper configuration. By being really specific with your build file, you clear all the guesswork from the consumers.

1 Like

I’m working on the ice/stone effect now, and will hopefully have a screenshot or clip to show soon.

However I have noticed a minor issue in the meantime (although it isn’t stopping me from making progress, just an inconvenience).

It looks like the SDK is not letting me open any assets in this project’s resources folder. Double clicking or right click > open doesn’t work, and If I try to force open it by using the “open as” and select the correct file type, then this error pops up:

Is this intended functionality for projects that have their assets in the resources folder? I don’t use the resources folder for my own projects and instead just keep things in the Assets directory and comment out a line in my gradle build file so it doesn’t rebuild the assets every time unless I’m doing a full clean/build. So this is uncharted territory for me using the resources folder instead.

I mostly only needed to open the model to see its animations so I know the name of the idle animation to play/pause that during the freeze effects. But I can get by without that part in the meantime.

1 Like

SDK is a bit picky. It requires the project to be set certain way in order to be recognized as a jME project. If it is not, then roughly none of the SDK features are available, it is just plain NB for that.

SDK wants the resources to be in assets folder for Ant and for Gradle in their own subproject/module for optimal builds.

3 Likes

Hi guys, how is it going? Do you have any difficulties in developing the other shaders for JME? Is there any tool I can develop to help you?

Cheers. :wink:

1 Like

I’m nearly done with a shader that will let you combine all of these effects at once, but since it’s all being packed into one highly customizable glsllib it is taking me a bit longer than if I were to hard code jtus one of the effects into its own unique shader. The last 2 days were also unusually warm for winter in my area so I ended up spending the time I’d usually be coding doing yard work instead.

But so far it’s going well and I should be able to merge my code to your repo in the next few days.

I only ran into 2 issues with the test-case so far but managed to solve them.

First I had trouble trying to set the window’s position, so I had to change your project’s “runtime only” import on lwjgl3 to instead be “implementation” in order to call a screen positioning method. This way I was able to make the screen full sized and centered without using fullscreen mode (probably wasn’t necessary, but that’s just my preference to have a windowed fullscreen type of view as the default in all my apps)

And then I also had some trouble tweaking matParams for the active effect on the models since they consist of more than one material, and the material editor interface only edits one material at a time. So I added some code that will sync any specified matParams (like the blending matParam) across all of a model’s materials.

I also may be going beyond the scope of a test-case, since I’m also splitting each effect into a separate class for convenience and to display the way each effect can be layered ontop of others in any order, and swapped around easily at runtime. And, since some float vars will be packed into a vec4’s x/y/z/w vars, it will also be better to have a java class that automatically does that so the user doesn’t have to understand the shader code as much in order to use the shader.

Here’s a peak at some code and some comments showing how I have it setup to support up to 6 blend layers all on one glsllib, although most of the variable names and types aren’t finalized yet and likely will change a bit:

//support up to 6 blend layers. can easily modify your shader to use more by increasing this value and adding the extra defines to support them
#for i=0..6 ( $0 )
    #ifdef BLENDLAYER_$i    
        uniform vec4 m_BlendLayer_$i_BlendVec; //note that this needs to be a vec4 to store all possible blending vals that change every frame, as to avoid the lag from changing a float parm every frame
    
        uniform float m_BlendLayer_$i_BaseColor; 
        uniform float m_BlendLayer_$i_NormalIntensity; 

        uniform float m_BlendLayer_$i_Roughness;
        uniform float m_BlendLayer_$i_Metallic;    
        
        uniform float m_BlendLayer_$i_EmissiveColor;
        uniform float m_BlendLayer_$i_EmissivePower;
        
        #ifdef BLENDLAYER_$i_HEIGHTBLENDMODE 
            uniform float floorHeightPercent; 
            uniform float roofHeightPercent;
//probably remove these 2 uniforms, and instead pack into the blending vec's y/z vals when this mode is enabled
            uniform float heightEdgeBlend; 
            
        #endif
        
        #ifdef BLENDLAYER_$i_NOISEDISSOLVE
            //use a noise based map or noise equations for dissolve or dissolve-like blending effects
            
            uniform vec4 DissolveEdgeColor;
            uniform float DisolveEdgeThickness;

        #endif
        
        #ifdef BLENDLAYER_$i_ALBEDOMAP
            uniform sampler2D m_AlbedoMap_$i;
        #endif

        #ifdef BLENDLAYER_$i_NORMALMAP
            uniform sampler2D m_BlendLayer_$i_NormalMap;
        #endif    

        #ifdef BLENDLAYER_$i_ROUGHNESSMETALLICMAP
            uniform float m_BlendLayer_$i_RoughnessMetallicAoMap; //not setup to use individual roughness and metallic maps since that is less optimized, but can easily add them if needed
        #endif

        #ifdef BLENDLAYER_$i_EMISSIVEMAP
            uniform float m_BlendLayer_$i_EmissiveMap;
        #endif
    #endif
#endfor 

So this way you can put something like the ghost effect on the first layer, then still have ice or petrify applied on the second and 3rd layer, and also put things like sheild armor or lightning on the 4th and 5th layer (or any order really, depending on your games needs of course). I’ve been reusing a lot of the concepts I learned from making the terrain shaders, however in this case there’s a lot more room to be creative since a character model is waay smaller than a terrain and can handle cool effects without affecting the framerate at all really.

And of course any shaders that use this lib that don’t want to have all the defines set for 6 blend layers can juts leave the defines undeclared in the j3md and the shader will ignore the extra blending layers at no extra cost.

Otherwise I haven’t run into any serious issues or limitations, so I will hopefully be done soon.

2 Likes

Probably worth pointing out that this sort of “combining” was precisely the problem that shader nodes was meant to solve. Not necessarily the GUI side of that but that coding side.

…but I think the ultimate implementation of shader nodes might obscure that and make it a little trickier than it needs to be. I haven’t looked into it for a long time.

The idea that you could compose a shader from parts instead of having 20 defines… that’s definitely shader nodes.

1 Like