ComputeShader | Cheney Shen

Technology blog


DirectCompute tutorial for Unity 7: Counter Buffers

So to continue this tutorial is about counter buffers. All the compute buffer types in Unity have a count property. For structured buffers this is a fixed value as they act like an array. For append buffers the count changes as the buffer is appended/consumed from as they act like a dynamic array. (所有类型buffer都有count property)…

Read More

DirectCompute tutorial for Unity 6: Consume buffers

This tutorial will be covering how to use consume buffers in Direct Compute. This tutorial was originally going to be combined with the append buffer tutorial as consume and append buffers are kinda the same thing. I decided it was best to split it up because the tutorial would have been a bit too long….

Read More

DirectCompute tutorial for Unity 5: Append buffers

In today’s tutorial I will be expanding on the topic of buffers covered in the last tutorial by introducing append buffers. These buffers offer greater flexibility over structured buffers by allowing you to dynamically increase their size during run time from a compute or Cg shader. (append buffer特点是灵活,size可变)   The great thing about these buffers…

Read More

DirectCompute tutorial for Unity 4: Buffers

In DirectCompute there are two types of data structures you will be using, textures and buffers. Last tutorial covered textures and today I will be covering buffers. While textures are good for data that needs filtering or mipmaping like color information, buffers or more suited to representing information for vertices like position or normals. Buffers…

Read More

DirectCompute tutorial for Unity 3: Textures

The focus of days tutorial is on textures. These are arguably the most important feature when using DirectCompute. It is highly likely that every shader you write will use at least one texture. Unfortunately render textures in Unity are Pro only so this tutorial covers Pro only topics. The good new is that this will…

Read More

DirectCompute tutorial for Unity 2: Kernels and thread groups

Today I will be going over the core concepts for writing compute shaders in Unity.   At the heart of a compute shader is the kernel. This is the entry point into the shader and acts like the Main function in other programming languages. I will also cover the tiling of threads by the GPU….

Read More

DirectCompute tutorial for Unity 1: Introduction

unity的GPGPU的使用方式computeshader真的非常让人震惊,代码已经不再向openCL,CUDA一样的难读难写难于维护,整体上已经非常好用了。 在这个基础上,等待显卡这两年的跨越式发展后,游戏中采用GPU的并行计算能力会变得非常普及。 这样以后对于原来CPU上面的所有的for/while/foreach等操作都可以进行GPU封装,让用户可以无意识的,或者简单选择的使用GPU并行计算能力。 原文地址: 下面开始是教程正文翻译,不想看英文只需看中文总结就可以: At this time Unity just started to support Microsofts DirectX 11 and with DirectX 11 came the DirectCompute API. This API opens up a whole new way to use the GPU by writing compute shaders. 【Unity GPGPU 很好用,但是没有教程让使用者非常难受,因此作者准备搞一发。】   I hope to start of with a introduction about why DirectCompute…

Read More
  • Categories

  • Tags