webgl - three.js - stuck on shaders -
this first post here; please excuse me if seems i'm lost, because am.
i'm working on implementing large terrain in webgl , three.js using heightmap. can want (so far) regular planegeometry - setting plane, reading , assigning altitude values heightmap, reading , interpolating inter-vertex altitudes heightmap player can walk smoothly along terrain without having refer geometry, , assigning textures , lights.
problem seem limited around 513x513 vertex plane; higher , starts either chug or crash. understand solution use buffergeometry , shaders offload heavy lifting gpu, , i've figured out how read altitudes array , hand array off gpu displacement, i've lost lighting information, , don't know how back. suppose add in own lights, i'm pretty sure there's way tell shader use scene's lights. think solution has shaderlib and/or uniformutils, don't know how use those, , examples i've found online broken.
so guess question this: how take parts of existing shaders (phong, lambert) , add them own code?
Comments
Post a Comment