소스 검색

Adjust Buffer docs;

bjorn 3 년 전
부모
커밋
56751fa0a4
4개의 변경된 파일11개의 추가작업 그리고 9개의 파일을 삭제
  1. 0 0
      api/init.lua
  2. 7 9
      api/lovr/graphics/Buffer/init.lua
  3. 2 0
      api/lovr/graphics/buffer.lua
  4. 2 0
      api/lovr/graphics/newBuffer.lua

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
api/init.lua


+ 7 - 9
api/lovr/graphics/Buffer/init.lua

@@ -2,16 +2,16 @@ return {
   summary = 'A block of memory on the GPU.',
   description = [[
     A Buffer is a block of GPU memory.  Buffers are similar to Lua tables or arrays: they have a
-    length and store a list of values.  The length of a Buffer and its format (the types of values
-    it stores) are declared upfront and can't be changed.  The data for a Buffer is stored in VRAM,
-    allowing Shaders running on the GPU to access the Buffer data.
+    length and store a list of values.  The length of a Buffer and its format (the type of each
+    value) are declared upfront and can't be changed.  Each value of a Buffer consists of one or
+    more fields, and each field has a type.  For example, if a Buffer is used to store vertices,
+    each value might store 3 fields for the position, normal vector, and UV coordinates of a vertex.
 
     Buffers are commonly used for:
 
-    - Mesh data: Buffers hold the data that define the vertices in a mesh, like positions, normals,
-      and UV coordinates.  Buffers also store the vertex indices of a mesh, which define how the
-      vertices are connected together into triangles.  These are respectively called vertex and
-      index buffers.
+    - Mesh data: Buffers hold the data that define the vertices in a mesh. Buffers also store the
+      vertex indices of a mesh, which define the order the vertices are connected together into
+      triangles. These are often called vertex buffers and index buffers.
     - Shader data: Buffers can be bound to a Shader, letting the Shader read arbitrary data. For
       example, Lua code could create a Buffer with the positions and colors of all the lights in a
       scene, which a Shader can use to do lighting calculations.
@@ -31,8 +31,6 @@ return {
       recreated every frame.  They often have faster performance when used by the GPU, and compute
       shaders can write to them.  They are great for large pieces of data that are initialized once
       at load time, or data that is updated infrequently.
-
-    Choose wisely!
   ]],
   constructors = {
     'lovr.graphics.buffer',

+ 2 - 0
api/lovr/graphics/buffer.lua

@@ -99,6 +99,8 @@ return {
       may be added in the future.
 
     If no table or Blob is used to define the initial Buffer contents, its data will be undefined.
+
+    There is currently a max of 16 fields.
   ]],
   related = {
     'lovr.graphics.newBuffer'

+ 2 - 0
api/lovr/graphics/newBuffer.lua

@@ -99,6 +99,8 @@ return {
       may be added in the future.
 
     If no table or Blob is used to define the initial Buffer contents, its data will be undefined.
+
+    There is currently a max of 16 fields.
   ]],
   related = {
     'lovr.graphics.buffer'

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.