NVIDIA Index example code nvidia_logo_transpbg.gif Up
xac_compute::trianglemesh Namespace Reference

Classes

class  Trianglemesh_setup
 

Variables

static const char * program_begin
 
static const char * program_end
 
static const char * color_program
 
static const char * compute_program
 

Variable Documentation

 color_program

const char* xac_compute::trianglemesh::color_program
static
Initial value:
=
" NV_IDX_DEVICE_INLINE_MEMBER int execute( \n"
" const Sample_info_self& sample_info, \n"
" Sample_output& sample_output) \n"
" { \n"
" sample_output.set_color(make_float4( \n"
" sample_info.texture_coordinates.x, \n"
" sample_info.texture_coordinates.y, \n"
" checker(sample_info.scene_position), \n"
" 1.f)); \n"
" \n"
" //sample_output.set_color(sample_info.sample_color); \n"
" return NV_IDX_PROG_OK; \n"
" } \n"

Definition at line 39 of file xac_compute_trianglemesh.cpp.

 compute_program

const char* xac_compute::trianglemesh::compute_program
static
Initial value:
=
" // The user program for compute. \n"
" NV_IDX_DEVICE_INLINE_MEMBER \n"
" int compute( \n"
" const Data_point_info_self& data_point_info, \n"
" Data_point_output& data_output) \n"
" { \n"
" const auto& surf = state.self; \n"
" unsigned attr_idx = surf.Attr_vertex_texture_coordinate; \n"
" float2 v = surf.get_attribute<float2>(attr_idx, data_point_info); \n"
" \n"
" // Modify value v. \n"
" v.x = 1.f - v.x; \n"
" v.y = 1.f - v.y; \n"
" \n"
" float3 pos = data_point_info.get_position(); \n"
" v *= checker(pos); \n"
" \n"
" data_output.write_value(attr_idx, v); \n"
" \n"
" return NV_IDX_PROG_OK; \n"
" } \n"

Definition at line 55 of file xac_compute_trianglemesh.cpp.

 program_begin

const char* xac_compute::trianglemesh::program_begin
static
Initial value:
=
";NV_IDX_XAC_VERSION_1_0 \n"
" \n"
"class Surface_sample_program \n"
"{ \n"
" NV_IDX_SURFACE_SAMPLE_PROGRAM \n"
" \n"
"public: \n"
" NV_IDX_DEVICE_INLINE_MEMBER void initialize() \n"
" { \n"
" } \n"
" \n"
" NV_IDX_DEVICE_INLINE_MEMBER float checker(const float3& pos) const \n"
" { \n"
" int box = 20; \n"
" int a = (int(pos.x) / box & 1); \n"
" int b = (int(pos.y) / box & 1); \n"
" return (a ^ b) ? 1.f : 0.f; \n"
" } \n"

Definition at line 14 of file xac_compute_trianglemesh.cpp.

 program_end

const char* xac_compute::trianglemesh::program_end
static
Initial value:
=
"}; \n"

Definition at line 35 of file xac_compute_trianglemesh.cpp.