Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
billboard [2020/01/10 12:22] – [Example: Terrain Grass Billboard] adminbillboard [2020/04/11 14:30] – [Billboard] admin
Line 4: Line 4:
  
 The billboard component is a mesh itself, into which proxies are merged. Much faster rendering is possible if proxy meshes are merge into one mesh, instead of rendering each mesh. The billboard component is a mesh itself, into which proxies are merged. Much faster rendering is possible if proxy meshes are merge into one mesh, instead of rendering each mesh.
 +
 +Restriction: multi-mesh models will be used as multiple source objects and not merged as one object. For example: if you have a model including a cube and sphere mesh, the cube and sphere will be registered as source objects. They will not be handled as single mesh.
  
 We typically use this technique for grass or trees. We typically use this technique for grass or trees.
Line 54: Line 56:
   FGrass := TGorillaBillboard.Create(FGorilla);   FGrass := TGorillaBillboard.Create(FGorilla);
   FGrass .Parent := FGorilla;   FGrass .Parent := FGorilla;
-  FGrass.SourceObject := LBillboard;+  FGrass.AddSourceObject(LBillboard);
   FGrass.MaterialSource := LGrassMat;   FGrass.MaterialSource := LGrassMat;
   FGrass.SetSize(GORILLA_BILLBOARD_SIZE, GORILLA_BILLBOARD_SIZE, GORILLA_BILLBOARD_SIZE);   FGrass.SetSize(GORILLA_BILLBOARD_SIZE, GORILLA_BILLBOARD_SIZE, GORILLA_BILLBOARD_SIZE);
Line 190: Line 192:
       // place billboard chunk over terrain       // place billboard chunk over terrain
       LGrass.Position.Point := Point3D(LX, 0, LZ);       LGrass.Position.Point := Point3D(LX, 0, LZ);
 +      
 +      // take the template model material source as material for the billboard
 +      // this could be replaced by a grass material shader of course
       LGrass.MaterialSource := FGrassTemps[0].Meshes[0].MaterialSource;       LGrass.MaterialSource := FGrassTemps[0].Meshes[0].MaterialSource;
       FGrassBillboards.Add(LGrass);       FGrassBillboards.Add(LGrass);