Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions docs/amber_script.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,57 @@ The following commands are all specified within the `PIPELINE` command.
POLYGON_MODE {mode}
```

#### Compare operations
* `never`
* `less`
* `equal`
* `less_or_equal`
* `greater`
* `not_equal`
* `greater_or_equal`
* `always`

```groovy
# Set depth test settings. All enable options are specified with keywords on and off.
# BOUNDS and BIAS values are specified with decimal numbers. |compare_op| is selected
# from the list of compare operations above.
DEPTH
TEST {test_enable}
WRITE {write_enable}
COMPARE_OP {compare_op}
CLAMP {clamp_enable}
BOUNDS min {bound_min} max {bounds_max}
BIAS constant {bias_constant} clamp {bias_clamp} slope {bias_slope}
END
```

#### Stencil operations
* `keep`
* `replace`
* `increment_and_clamp`
* `decrement_and_clamp`
* `invert`
* `increment_and_wrap`
* `decrement_and_wrap`

```groovy
# Set stencil test settings. |face| can be front, back, or front_and_back.
# |test_enable| is either on or off and affects both faces. |fail_op|, |pass_op|,
# and |depth_fail_op| are selected from the stencil operations table above,
# and |compare_op| from the compare operations table. |compare_mask|, |write_mask|,
# and |reference| are 8bit unsigned integer values (range 0..255).
STENCIL {face}
TEST {test_enable}
FAIL_OP {fail_op}
PASS_OP {pass_op}
DEPTH_FAIL_OP {depth_fail_op}
COMPARE_OP {compare_op}
COMPARE_MASK {compare_mask}
WRITE_MASK {write_mask}
REFERENCE {reference}
END
```

```groovy
# Set the size of the render buffers. |width| and |height| are integers and
# default to 250x250.
Expand Down
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ if (${AMBER_ENABLE_TESTS})
amberscript/parser_compile_options_test.cc
amberscript/parser_copy_test.cc
amberscript/parser_device_feature_test.cc
amberscript/parser_depth_test.cc
amberscript/parser_expect_test.cc
amberscript/parser_extension_test.cc
amberscript/parser_framebuffer_test.cc
Expand All @@ -148,6 +149,7 @@ if (${AMBER_ENABLE_TESTS})
amberscript/parser_set_test.cc
amberscript/parser_shader_opt_test.cc
amberscript/parser_shader_test.cc
amberscript/parser_stencil_test.cc
amberscript/parser_struct_test.cc
amberscript/parser_test.cc
buffer_test.cc
Expand Down
Loading