TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Demo of Agent Based Model on GPU with CUDA and OpenGL (Windows/Linux)

55 点作者 ktt8788超过 1 年前
Demo of agent based model on GPU with CUDA and OpenGL (Windows&#x2F;Linux)<p>Agent instances on GPU memory Uses SSBO for instanced objects (with GLSL 450 shaders) CUDA OpenGL interops Renders with GLFW3 window manager Dynamic camera views in OpenGL (pan,zoom with mouse) Libraries installed using vcpkg<p>(<a href="https:&#x2F;&#x2F;github.com&#x2F;KienTTran&#x2F;ABMGPU">https:&#x2F;&#x2F;github.com&#x2F;KienTTran&#x2F;ABMGPU</a>)

10 条评论

macawfish超过 1 年前
What exactly is an &quot;agent based model&quot; in this case? What I see is a lot of triangles moving around, but what exactly drives them?
评论 #38523550 未加载
评论 #38523470 未加载
jasonjmcghee超过 1 年前
You should work on inter-agent interaction next! It&#x27;s so much fun.<p>I have played with this a fair amount and put a couple of my experiments in a repo- both slime mold simulation and &quot;particle life&quot;.<p>Here&#x27;s the repo: <a href="https:&#x2F;&#x2F;github.com&#x2F;jasonjmcghee&#x2F;compute-shaders">https:&#x2F;&#x2F;github.com&#x2F;jasonjmcghee&#x2F;compute-shaders</a><p>And a video of the slime mold: <a href="https:&#x2F;&#x2F;twitter.com&#x2F;_jason_today&#x2F;status&#x2F;1663378736098738177?s=46&amp;t=ZjF9if4qtE9ppAnug9UOPQ" rel="nofollow noreferrer">https:&#x2F;&#x2F;twitter.com&#x2F;_jason_today&#x2F;status&#x2F;1663378736098738177?...</a>
评论 #38525493 未加载
TheHideout超过 1 年前
Are the agents independent or are they affected by neighbors? It would be nice to see some classic ABM examples like wolf-sheep population, flocking, and wildfire spread to demonstrate the utility of this.
评论 #38525476 未加载
TheEzEzz超过 1 年前
Super cool, curious to see where you take this! I did some work on GPGPU for agent simulations for an RTS years ago ( <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=P4fKJIrv0J8" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=P4fKJIrv0J8</a> ). Doing things like pathfinding on the GPU gets tricky, especially taking into account how agents affect paths of other agents. Happy to jam anytime if you&#x27;re brainstorming applications.
评论 #38525510 未加载
moritonal超过 1 年前
If you want to create some pretty effects, add the concept of a velocity-texture which is added to agents velocity as they pass over it. Then let the user draw on the texture. Very cheap way to get interactivity. My own version from before compute shades were a thing (<a href="https:&#x2F;&#x2F;moritonal.github.io&#x2F;force-particles&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;moritonal.github.io&#x2F;force-particles&#x2F;</a>)
评论 #38525998 未加载
posnet超过 1 年前
Another fun one, not sure about accuracy, but the visuals are stunning.<p><a href="https:&#x2F;&#x2F;youtu.be&#x2F;dSkxvi9igqQ" rel="nofollow noreferrer">https:&#x2F;&#x2F;youtu.be&#x2F;dSkxvi9igqQ</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;chrxh&#x2F;alien&#x2F;">https:&#x2F;&#x2F;github.com&#x2F;chrxh&#x2F;alien&#x2F;</a>
评论 #38525994 未加载
m-murphy超过 1 年前
Are the entities interacting in any way here? That&#x27;s pretty critical for agent based models as they enable complicated&#x2F;unexpected emergent behavior from simplified rules due to the interactions of the entities.
评论 #38525525 未加载
m-murphy超过 1 年前
Another related project for ABMs utilizing GPUs: <a href="https:&#x2F;&#x2F;docs.flamegpu.com&#x2F;guide&#x2F;index.html" rel="nofollow noreferrer">https:&#x2F;&#x2F;docs.flamegpu.com&#x2F;guide&#x2F;index.html</a>
评论 #38525531 未加载
sgt101超过 1 年前
reminds me of the flocking demos 20 years ago...
评论 #38525543 未加载
westurner超过 1 年前
Could this work in WebGL and&#x2F;or WebGPU (and&#x2F;or WebNN) with or without WASM in a browser?<p><a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;48228192&#x2F;webgl-compute-shader-and-vbo-ubos" rel="nofollow noreferrer">https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;48228192&#x2F;webgl-compute-s...</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;conda-forge&#x2F;glfw-feedstock&#x2F;blob&#x2F;main&#x2F;recipe&#x2F;meta.yaml">https:&#x2F;&#x2F;github.com&#x2F;conda-forge&#x2F;glfw-feedstock&#x2F;blob&#x2F;main&#x2F;reci...</a><p>pyglfw: <a href="https:&#x2F;&#x2F;github.com&#x2F;conda-forge&#x2F;pyglfw-feedstock&#x2F;blob&#x2F;main&#x2F;recipe&#x2F;meta.yaml">https:&#x2F;&#x2F;github.com&#x2F;conda-forge&#x2F;pyglfw-feedstock&#x2F;blob&#x2F;main&#x2F;re...</a><p>- [ ] glfw recipe for <i>emscripten</i>-forge: <a href="https:&#x2F;&#x2F;github.com&#x2F;emscripten-forge&#x2F;recipes&#x2F;tree&#x2F;main&#x2F;recipes&#x2F;recipes_emscripten">https:&#x2F;&#x2F;github.com&#x2F;emscripten-forge&#x2F;recipes&#x2F;tree&#x2F;main&#x2F;recipe...</a><p>Emscripten porting docs &gt; OpenGL ES 2.0&#x2F;3.0 *, glfw: <a href="https:&#x2F;&#x2F;emscripten.org&#x2F;docs&#x2F;porting&#x2F;multimedia_and_graphics&#x2F;OpenGL-support.html" rel="nofollow noreferrer">https:&#x2F;&#x2F;emscripten.org&#x2F;docs&#x2F;porting&#x2F;multimedia_and_graphics&#x2F;...</a><p>WebGPI API &gt; GPUBuffer: <a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;API&#x2F;WebGPU_API" rel="nofollow noreferrer">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;API&#x2F;WebGPU_API</a><p>gpuweb&#x2F;gpuweb: <a href="https:&#x2F;&#x2F;github.com&#x2F;gpuweb&#x2F;gpuweb">https:&#x2F;&#x2F;github.com&#x2F;gpuweb&#x2F;gpuweb</a><p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=38355444">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=38355444</a> :<p>&gt; <i>It actually looks like pygame-web (pygbag) supports panda3d and harfang in WASM</i><p>Harfang and panda3d do 3D with WebGL, but FWIU not yet agents in SSBO&#x2F;VBO&#x2F;GPUBuffer.<p>SSBO: Shader Storage Buffer Object: <a href="https:&#x2F;&#x2F;www.khronos.org&#x2F;opengl&#x2F;wiki&#x2F;Shader_Storage_Buffer_Object" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.khronos.org&#x2F;opengl&#x2F;wiki&#x2F;Shader_Storage_Buffer_Ob...</a><p>&#x2F;? WebGPU compute: <a href="https:&#x2F;&#x2F;www.google.com&#x2F;search?q=webgpu+compute" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.google.com&#x2F;search?q=webgpu+compute</a><p>&quot;WebGPU Compute Shader Basics&quot; <a href="https:&#x2F;&#x2F;webgpufundamentals.org&#x2F;webgpu&#x2F;lessons&#x2F;webgpu-compute-shaders.html" rel="nofollow noreferrer">https:&#x2F;&#x2F;webgpufundamentals.org&#x2F;webgpu&#x2F;lessons&#x2F;webgpu-compute...</a>
评论 #38530056 未加载