Skip to content

TampaDevs/bayhacks.dev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Commands

  • npx gltfjsx chair.glb -i -T -S -R 256
  • npx gltfjsx edit.glb -T -R 256 -S --error .0001
    • used with the canyon, without the error flag it will have holes in it
  • ctrl + alt + \ = hide controls

Cool drei things

  • MeshReflectorMaterial (medium)
  • MeshRefractionMaterial (hard)
    • could be used for water
  • MeshDistortMaterail (medium)
  • Trail (hard)
  • Positional Audio (Simple)
    • vanilla = webaudio_orientation
  • spotlight
  • shadows
  • sparkles
  • decals (hard)
  • instanced grass

vanilla

  • light hemisphere
  • rectarealight
  • lines
  • points / sprites
  • shaders / ocean
  • playground
  • points (fire)
  • postprocessing effects (should switch to FXAA or SMAA since MSAA doesn't do great with PP)
  • toon material

questions

how does shadowmap work?

what is shadowMaterial? how do lightmaps work? is baking shadows worth it? Can I use render order for creating a seamless flow?

Links

Examples

Info

Mobile

  • window.devicePixelRatio
    • if above 1 consider disabling AA
  • set Far prop lower on mobile
  • try setting max pixel ratio

Materials

  • basic is fastest but no shadowing
  • lambert is next, then phong
  • standard for quality
  • textures should be power of 2 in size

Other

  • disable alpha buffer
  • light.visible = false || light.intensiy = 0 instead of removing lights
  • object.visible = false || material.opacity = 0 instead of removing object
  • use CameraHelper to view frustum, the smaller this can be the better
  • make shadow texture as low as possible
  • object.matrixAutoUpdate = false for static object or rarely moved
  • alphatest is faster than transparent obj
  • bake lighting and shadows
  • use LOD object and only do cheap position/animation changes
  • can use layers if changing visibility of several objects

Stats

console.log("Scene polycount:", renderer.info.render.triangles)
console.log("Active Drawcalls:", renderer.info.render.calls)
console.log("Textures in Memory", renderer.info.memory.textures)
console.log("Geometries in Memory", renderer.info.memory.geometries)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •