indievisuallab / unitygraphicsprogramming Goto Github PK
View Code? Open in Web Editor NEW書籍「UnityGraphicsProgramming vol.1」のサンプルコードリポジトリ
Home Page: https://indievisuallab.github.io/
License: MIT License
書籍「UnityGraphicsProgramming vol.1」のサンプルコードリポジトリ
Home Page: https://indievisuallab.github.io/
License: MIT License
I'm using 2018.3.6f1, MacBook Pro. I found out that some compute shaders are not correctly compiled on Metal because the lines of #pragma kernel contain comments. Unity shows error like "Macro names must be identifiers at kernel [KERNEL_NAME] metal :00".
ex) Boids.compute
// カーネル関数を指定
#pragma kernel ForceCS // 操舵力を計算
#pragma kernel IntegrateCS // 速度, 位置を計算
When I remove comments at the right, I can run samples without problems.
// カーネル関数を指定
#pragma kernel ForceCS
#pragma kernel IntegrateCS
Maybe it's Unity bug but I think it's safe to delete comments after #pragma kernel lines.
For the StableFluid - Solver2D.cs, you didn't assign texture for the Project-Step2 kernel and it causes an error on Unity 2019 version. It is fine on Unity2017 but can be an issue on Unity2019.
I would suggest you add below code at line 93 and 117.
computeShader.SetTexture(kernelMap[ComputeKernels.ProjectStep2], velocityId, velocityTex);
And also on the Solver2D.compute, on 'AdvectVelocity' kernel function,
at line 234, you used GetDimensions(w,h) using density texturebuffer which requires SetTexture(density),
in this context, using velocity texturebuffer is better way to solve the error.
(x)
density.GetDimensions(w, h);
(o)
velocity.GetDimensions(w, h);
Thank you for the awesome code!
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.