日本熟妇hd丰满老熟妇,中文字幕一区二区三区在线不卡 ,亚洲成片在线观看,免费女同在线一区二区

構(gòu)造一個(gè)材質(zhì)對(duì)象。

語法

material ST_MakeMaterial(cstring ambient default NULL,
                         cstring diffuse default NULL,
                         cstring specular default NULL,
                         integer shininess default NULL,
                         integer transparency default NULL,
                         integer texture_index default NULL);
material ST_MakeMaterial(text table_name,
                         text column_name,
                         text key_value,
                         text schema_name default NULL);
material ST_MakeMaterial(cstring attributes,
                         texture[] textures default NULL);

參數(shù)

參數(shù)名稱

描述

ambient

環(huán)境顏色光,用16進(jìn)制字符串表示RGBA顏色,例如:#FF88FF00

diffuse

散射光,用16進(jìn)制字符串表示RGBA顏色,例如:#FF88FF00

specular

鏡面光顏色,用16進(jìn)制字符串表示RGBA顏色,例如:#FF88FF00

shininess

光澤度,取值:0~100。

transparency

透明度,取值:0~100。

texture_index

材質(zhì)所對(duì)應(yīng)紋理的索引信息,取值:0~32767。

table_name

已存在material的表名。

column_name

已存在material的列名。

key_value

已存在material的查詢唯一ID,用于where條件中。

schema_name

已存在material的方案名,默認(rèn)為用戶search path中表所在的Schema。

attributes

基于JSON類型的材質(zhì)描述信息,形式為GLTF中的PBR材質(zhì)描述。

textures

material所包含的textures數(shù)組。

描述

構(gòu)造一個(gè)材質(zhì)對(duì)象。

  • 語法一提供了基于OpenCL類型的材質(zhì)描述信息,最終會(huì)轉(zhuǎn)換為基于JSON的表述形式。

  • 語法二提供了基于其他表中存儲(chǔ)的材質(zhì)信息,可以有效地降低Mesh的數(shù)據(jù)量,方便統(tǒng)一進(jìn)行修改。

  • 語法三提供了基于JSON類型的材質(zhì)描述信息。

示例

  • 語法一:

    -- form 1
    SELECT ST_AsText(ST_MakeMaterial('#FFDDEEAA', '#FFDDEEAA', '#FFDDEEAA', 30, 70, 2));
    
    --------------------------------------------------------------------------------
    {"type":"raw", "attributes": {"ambient":"#FFDDEEAA","diffuse":"#FFDDEEAA","specular":"#FFDDEEAA","shininess":30,"transparency":70,"texture":2}}
    
    
    -- form 1
    SELECT ST_AsText(ST_MakeMaterial(diffuse => '#FFDDEEAA'));
    
    -------------------------
     {"type":"raw", "attributes": {"diffuse":"#FFDDEEAA"}}
  • 語法二:

    -- form 2,reference to other material object
     SELECT ST_AsText(ST_MakeMaterial('t_material'::text,
        'the_material'::text,
        'num=1'::text));
     -----------------------------
     {"type":"db", "attributes": {"schema":"public","table":"t_material","column":"the_material","key":"num=1"}}
  • 語法三:

    -- form3, with PBR json string and textures
    SELECT ST_AsText(ST_MakeMaterial('{"pbrMetallicRoughness": {"baseColorFactor": [ 1.000, 0.766, 0.336, 1.0 ], "metallicFactor": 0.5,"roughnessFactor": 0.1}}',
                                     ARRAY(SELECT the_texture from t_texture)));
    -----------------------------
    {"type":"raw", "textures":[{"compressionType" : "None", "format" : "JPEG", "wrap" : "Wrap", "type" : "Raw", "depth" : 3, "width" : 256, "height" : 256, "size" : 6, "data" : "313233343536"}], "attributes": {"pbrMetallicRoughness":{"baseColorFactor":[1.0,0.766,0.336,1.0],"metallicFactor":0.5,"roughnessFactor":0.1}}}