ealrann / vsand Goto Github PK
View Code? Open in Web Editor NEWRewrite of the "Falling Sand" game with Vulkan.
License: GNU General Public License v3.0
Rewrite of the "Falling Sand" game with Vulkan.
License: GNU General Public License v3.0
Sometimes, the draw is discontinuous.
cd VSand/VSand/
There is no VSand
folder here any more?
VSand could have a better look with different colours.
For example, when the Fuel burn, an intermediate hidden material ("sparkle") is created to propagate the fire. This sparkle is dark red, but it doesn't look really convincing.
They can be tweaked in this file, by simply changing the R, G and B fields (red, green and blue):
VSand/org.sheepy.vsand/src/main/resources/Application.vsand
Lines 317 to 339 in 4e48bcc
After a change, simply run ./gradlew run
to launch the game with your new colours.
Since I'm pretty bad with colours, I let this issue open and ask for help.
For now, the update rate depends on the refresh rate of the display, so a game launched on a 120Hz screen will run faster.
For responsiveness, the game should be rendered at the speed of the screen, but the game board should be updated at a fixed rate.
Here the steps required to compile under MacOS (thanks a lot to @kvark #23 ) :
git clone --recursive --single-branch --branch root https://github.com/Ealrann/VSand.git
cd VSand/
git checkout 7fa5a9d
git submodule update
Note : The head version appears to be currently broken on MacOS. After some digging, it looks like some bugs inside GLFW. They fixed some stuf recently related to the MacOS support, but the last LWJGL Snapshot is older than these fix. I'll update the macos compilation when LWJGL will be updated.
The last LWJGL Snapshot contains some mandatory fix for GLFW. Edit the file Lily-vulkan/gradle.properties
and change the Lwjgl version :
lwjglVersion = 3.2.4-SNAPSHOT
Macos requires some UI library to run inside the native thread, so we need to pass a special argument to the JVM. More information here and here.
Edit the file Vsand/VSand/org.sheepy.vsand/build.gradle
and add the -XstartOnFirstThread
arg :
application {
mainModule = 'org.sheepy.vsand'
mainClass = 'org.sheepy.vsand.VSandApplicationLauncher'
applicationDefaultJvmArgs = ["-XstartOnFirstThread"]
}
Go to the directory Vsand/VSand
and run :
./gradlew run
You need to specify the path to the library libvulkan.dylib
. To do so, an extra jvmarg is required. See this post for more information.
Edit the file Vsand/VSand/org.sheepy.vsand
and add the -Dorg.lwjgl.vulkan.libname
arg :
application {
mainModule = 'org.sheepy.vsand'
mainClass = 'org.sheepy.vsand.VSandApplicationLauncher'
applicationDefaultJvmArgs = ["-XstartOnFirstThread", "-Dorg.lwjgl.vulkan.libname=<path_to_vulkan_sdk>/macOS/lib/libvulkan.dylib"]
}
Is it possible to utilize MoltenVK to add support for macOS? It's a thin wrapper around the native Metal API available on macOS. As an example, the Dolphin project was able to add support using MoltenVK - though that's a C++ project versus Java - hopefully there aren't a significant number of differences or issues preventing implementation.
Since the big rewrite of the compute shader 6b5c0f0, the game use double buffering. To display the right buffer, without making a transfert (because I don't want it), is to call too times the update shader, to always print the board1 on screen:
We shouldn't update two times in a row when the speed of the game is 1. This pipeline have to be dynamic, and rebuilt every time the speed change, and present the last updated buffer.
A better solution would be to implement some swap buffer mechanism (for compute pipeline first) on https://github.com/Ealrann/Lily-Vulkan project.
It looks like the code issues a vkCmdBlitImage
operation on a swapchain image without checking if the TRANSFER_SRC
/TRANSFER_DST
usages are even supported on the swapchains by calling vkGetPhysicalDeviceSurfaceCapabilitiesKHR
.
Vulkan doesn't guarantee that anything but COLOR_ATTACHMENT usage is supported. Could we have VSand compatible with such drivers?
If you just drop some water in empty space you'll see that particles will go slightly to the left.
Randomly, the UI is blinking.
I suspect the draw of the UI overridden by the blit of the computed pixel image.
I followed your instructions and get BUILD FAILD:
First ... setup a JDK 14
clone the repo using:
git clone --recursive --single-branch --branch root https://github.com/Ealrann/VSand.git
launch the game:
#Go to the VSand project directory
cd VSand/VSand/
#Use gradle to run it
./gradlew run
Now I got the BUILD FAILED in 25s. After reading your instructions further,
I generated an access token and edit files.
After second gradlew run I got the following message (only in 3s, at first run I got same message in 25s):
FAILURE: Build failed with an exception.
Could not resolve all task dependencies for configuration ':org.sheepy.vsand:runtimeClasspath'.
Could not resolve emf.standalone:org.eclipse.emf.common:2.21.0.
Required by:
project :org.sheepy.vsand > project :Lily-vulkan:org.sheepy.lily.vulkan.api > project :Lily-vulkan:org.sheepy.lily.game.api > project :Lily-core:org.sheepy.lily.core.api
> Could not resolve emf.standalone:org.eclipse.emf.common:2.21.0.
> Could not get resource 'https://maven.pkg.github.com/ealrann/emf-standalone/emf/standalone/org.eclipse.emf.common/2.21.0/org.eclipse.emf.common-2.21.0.pom'.
> Username must not be null!
Could not resolve emf.standalone:org.eclipse.emf.ecore:2.21.0.
Required by:
project :org.sheepy.vsand > project :Lily-vulkan:org.sheepy.lily.vulkan.api > project :Lily-vulkan:org.sheepy.lily.game.api > project :Lily-core:org.sheepy.lily.core.api
> Could not resolve emf.standalone:org.eclipse.emf.ecore:2.21.0.
> Could not get resource 'https://maven.pkg.github.com/ealrann/emf-standalone/emf/standalone/org.eclipse.emf.ecore/2.21.0/org.eclipse.emf.ecore-2.21.0.pom'.
> Username must not be null!
Could not resolve emf.standalone:org.eclipse.emf.ecore.xmi:2.21.0.
Required by:
project :org.sheepy.vsand > project :Lily-vulkan:org.sheepy.lily.vulkan.api > project :Lily-vulkan:org.sheepy.lily.game.api > project :Lily-core:org.sheepy.lily.core.api
> Could not resolve emf.standalone:org.eclipse.emf.ecore.xmi:2.21.0.
> Could not get resource 'https://maven.pkg.github.com/ealrann/emf-standalone/emf/standalone/org.eclipse.emf.ecore.xmi/2.21.0/org.eclipse.emf.ecore.xmi-2.21.0.pom'.
> Username must not be null!
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 3s
Are there any further instructions
Add an UI label somewhere to display the version number.
Add some information about shortcut:
Maybe some focus for the color buttons?
On Nvidia GTX 1070, after placing some moving material (sand, water), error when Submitting draw command buffer:
System Extensions:
VK_EXT_debug_report
VK_EXT_display_surface_counter
VK_KHR_get_physical_device_properties2
VK_KHR_get_surface_capabilities2
VK_KHR_surface
VK_KHR_win32_surface
VK_KHX_device_group_creation
VK_KHR_external_fence_capabilities
VK_KHR_external_memory_capabilities
VK_KHR_external_semaphore_capabilities
VK_NV_external_memory_capabilities
System Layers:
VK_LAYER_NV_optimus
VK_LAYER_VALVE_steam_overlay
VK_LAYER_LUNARG_standard_validation
Graphic Device : GeForce GTX 1070
maxImageDimension2D: 32768
maxUniformBufferRange: 65536
maxStorageBufferRange: 2147483647
maxPushConstantsSize: 256
in (1.0, 1.0) (3.4028235E38, 3.4028235E38)
FPS: 89.132286
FPS: 120.73703
FPS: 89.823044
FPS: 120.26227
FPS: 120.010155
FPS: 120.04769
failed to submit draw command buffer!
FPS: 20.578407
UI draw pipeline should support redraw.
Fall down, explode when touching something.
Same behaviour than lava, without fire ?
done: #18
We need the ability to put some static material. Two solutions:
Fall down of particle could be optimized: the swap could be made per column of matter.
Iterate the same materials that does not want to move.
Is there a way to make this instance extension optional instead of required?
The random uniform buffer is just an uint, and is updated every frame.
It would better be a push constant.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.