Slide 1

Slide 1 text

ϝλόʔεΛࢧ͑Δٕज़ ʙUGCʹᷓΕΔ3DۭؒͷϦΞϧλΠϜ௨৴Λࢧ͑ΔGoʙ Ϋϥελʔגࣜձࣾ thara 2022-04-23 Go Conference 2022 Spring (Online)

Slide 2

Slide 2 text

Cluster, Inc. All Rights Reserved. ࣗݾ঺հ 2 thara • Tomochika Hara (ݪ ஌Ѫ) • Ѫ஌ݝࡏॅϦϞʔτϫʔΧʔ • ૒ࢠͷ෕ • झຯ • NESΤϛϡϨʔλ࣮૷ @zetta1985

Slide 3

Slide 3 text

Cluster, Inc. All Rights Reserved. ϝλόʔεϓϥοτϑΥʔϜ cluster ͱ͸ 3

Slide 4

Slide 4 text

Cluster, Inc. All Rights Reserved. ϝλόʔεϓϥοτϑΥʔϜ cluster ͱ͸ 4

Slide 5

Slide 5 text

Cluster, Inc. All Rights Reserved. ϝλόʔεϓϥοτϑΥʔϜ cluster ͱ͸ 5

Slide 6

Slide 6 text

Cluster, Inc. All Rights Reserved. ࠓ೔࿩͢͜ͱ 6 • ϝλόʔεΛߏ੒͢Δཁૉٕज़ • ϝλόʔεϓϥοτϑΥʔϜͷόοΫΤϯυͱGo • room serverͷมભͱ಺෦ΞʔΩςΫνϟ

Slide 7

Slide 7 text

ϝλόʔεΛߏ੒͢Δཁૉٕज़

Slide 8

Slide 8 text

Cluster, Inc. All Rights Reserved. ϝλόʔεΛߏ੒͢Δཁૉٕज़ 8 3࣍ݩͷԾ૝ۭؒ UGC ΤίγεςϜ

Slide 9

Slide 9 text

Cluster, Inc. All Rights Reserved. 3࣍ݩͷԾ૝ۭؒ 9 • Unity3d • ϦΞϧλΠϜಉظ • Ξόλʔͷ࢟੎৘ใ • ϘΠενϟοτ • ϞϊͷҐஔɾ޲͖

Slide 10

Slide 10 text

Cluster, Inc. All Rights Reserved. UGC ( = User Generated Contents) 10 • Ξόλʔ • ϫʔϧυ • Ϋϥϑτ

Slide 11

Slide 11 text

Cluster, Inc. All Rights Reserved. ΤίγεςϜ 11 • ΞϓϦ಺௨՟ • UGCͷചങ • Πϕϯτνέοτ • ΠϕϯτͰͷ౤͛મ

Slide 12

Slide 12 text

ϝλόʔεϓϥοτϑΥʔϜͷόοΫΤϯυͱGo

Slide 13

Slide 13 text

Cluster, Inc. All Rights Reserved. શମߏ੒ 13

Slide 14

Slide 14 text

Cluster, Inc. All Rights Reserved. શମߏ੒ 14 6($ ΤίγεςϜ ࣍ݩͷԾ૝ۭؒ

Slide 15

Slide 15 text

Cluster, Inc. All Rights Reserved. APIαʔόʔ 15 The Go gopher was designed by Renée French. • Ϣʔβʔೝূ • ϑϨϯυ • UGC؅ཧ • ೖࣨ؅ཧ • ܾࡁ

Slide 16

Slide 16 text

Cluster, Inc. All Rights Reserved. UGCύΠϓϥΠϯ 16 The Go gopher was designed by Renée French. • VRM, glTF • reduction • native texture

Slide 17

Slide 17 text

Cluster, Inc. All Rights Reserved. glTF 17 • JSONʹΑΔ3DϞσϧ΍γʔϯΛදݱ͢ΔσʔλϑΥʔϚοτ • ૬ޓӡ༻ɾ༰ྔɾϥϯλΠϜॲཧͷޮ཰Խ • ʮ3Dʹ͓͚ΔJPEGʯ IUUQTHJUIVCDPN,ISPOPT(SPVQHM5'CMPCNBJOTQFDJ fi DBUJPO fi HVSFTHM5'@3(#@+VOFTWH

Slide 18

Slide 18 text

Cluster, Inc. All Rights Reserved. VRM 18 • ϓϥοτϑΥʔϜඇґଘͷ3DΞόλʔϑΝΠϧϑΥʔϚοτ • glTF-2.0Λϕʔεʹ͍ͯ͠Δ • ώϡʔϚϊΠυɾඪ४ͷإૢ࡞ɾҰਓশࢹ఺࠶ݱɾϥΠηϯε IUUQTWSNEFW

Slide 19

Slide 19 text

Cluster, Inc. All Rights Reserved. VRMΛGoͰѻ͏ 19 https://github.com/qmuntal/gltf ΛϕʔεʹVRMʹରԠ type VRMExtension struct{ ... } func init() { gltf.RegisterExtension("VRM", func(data []byte) (interface{}, error) { var vrm VRMExtensio n err := json.Unmarshal(data, vrm ) return vrm, er r } ) } func DecodeVRM(raw []byte) (*gltf.Document, *VRMExtension, error) { var doc gltf.Documen t if err := gltf.NewDecoder(bytes.NewReader(raw)).Decode(&doc); err != nil { // error handling } return &doc, doc.Extensions["VRM"].(*VRMExtension), nil }

Slide 20

Slide 20 text

Cluster, Inc. All Rights Reserved. reduction/GPU native texture 20 func (c *converter) bufferViewImage ( src *gltf.Document, index uint32, dst *gltf.Document) (uint32, string, error) { bv := src.BufferViews[index ] buf, err := modeler.ReadBufferView(src, bv ) if err != nil { // error handling } // reduction & GPU native texture encoding converted, mimeType, err := converter.Convert(buf ) if err != nil { // error handling } newIndex := modeler.WriteBufferView(dst, gltf.TargetNone, converted ) return newIndex, mimeType, nil }

Slide 21

Slide 21 text

Cluster, Inc. All Rights Reserved. room server 21 The Go gopher was designed by Renée French.

Slide 22

Slide 22 text

room serverͷมભͱ಺෦ΞʔΩςΫνϟ

Slide 23

Slide 23 text

Cluster, Inc. All Rights Reserved. pubsubͷΈ (room serverҎલ) 23 • ۭؒಉظͰ͋Ε͹͜ΕͰे෼ • message΁ͷׯব͸Ͱ͖ͳ͍ • = ࣮ݱͰ͖Δػೳʹ੍ݶ

Slide 24

Slide 24 text

Cluster, Inc. All Rights Reserved. pubsubͷΈ (room server) 24 • ୯ʹMQTTΛ͠Ό΂Δ͚ͩͷ Go੡TCPαʔόʔ • hack͢ΔͨΊͷԼ஍

Slide 25

Slide 25 text

Cluster, Inc. All Rights Reserved. Actor 25 • client͝ͱͷॲཧ͕Մೳʹ • messageͷfiltering • LOD • Ξόλʔ࢟੎৘ใ • ϘΠε

Slide 26

Slide 26 text

Cluster, Inc. All Rights Reserved. Actor 26

Slide 27

Slide 27 text

Cluster, Inc. All Rights Reserved. Actor + global state 27 • globalͳঢ়ଶΛߋ৽Մೳʹ • ϫʔϧυΫϥϑτ • = ஔ͍ͨϞϊͷӬଓԽ

Slide 28

Slide 28 text

Cluster, Inc. All Rights Reserved. Actor + global state 28

Slide 29

Slide 29 text

Cluster, Inc. All Rights Reserved. Next…? 29 • ͍ͩͿ໰୊΁ͷཧղ͕ਐΜͩ • ൚༻తͳ݁߹͔ΒɺΑΓҙຯ Λ࣋ͬͨߏ଄΁ • ߋͳΔ௨৴ྔ࡟ݮ • UDPϕʔεͷಠࣗϓϩτίϧ

Slide 30

Slide 30 text

·ͱΊ

Slide 31

Slide 31 text

Cluster, Inc. All Rights Reserved. ·ͱΊ 31 • ϝλόʔεΛߏ੒͢Δཁૉٕज़ • 3࣍ݩͷԾ૝ۭؒ • UGC • ΤίγεςϜ • clusterͰ͸ͦͷόοΫΤϯυΛ Go Ͱ࣮ݱͯ͠·͢

Slide 32

Slide 32 text

IUUQTSFDSVJUDMVTUFSNVFOHJOFFS

Slide 33

Slide 33 text

Thanks for Listening