- Node 22
- A browser with WebGPU support
- Optional but recommended pnpm
npm install
npm run dev
- Open http://localhost:3000
https://vis2-rtvis-2024ws.yannic.at/
- Pick a Computed Structure Models (CSMs) from here.
- Download the models CIF file.
- Convert the CIF to PDB here.
- Run the
pdb_to_conect
notebook found in thepdb-processing
folder. - The resulting pdb file can be used in this project.
If the conversion fails at step 4, you may have supplied an invalid molecule file. Through testing we found that many experimentally-determined PDB structures do strictly adhere to the pdb file format and cannot be parsed correctly.
Alternatively, try generating a topology file with the create-topology.sh
bash script. Feed the topology file to gromologist alongside the cleaned pdb. You may get better results this way.
The Camera component manages the viewpoint and perspective within the 3D scene. It handles parameters such as position, orientation, field of view, and projection matrices, enabling users to navigate and visualize the scene from different angles.
Holds all vertices and indices belonging to a piece of geometry. Has helper functions for writing vertex and index buffers to the GPU.
Holds a material and provides a function for writing data to the GPU.
Basic 3D object that holds all data required for calculating the model matrix.
WebGPU-specific object that extends Object3D
with load
, update
and render
functions.
There is an instanced variant of the SceneObject
. When the same SceneObject
is used multiple times, using instancing can greatly boost performance.
It allows efficient endering of multiple copies of the same geometry with varying transformations and materials. This technique reduces the overhead of drawing numerous objects by batching them into a single draw call, enhancing performance.
Wrapper object that holds a number of SceneObjects
and provides functions for drawing and updating them.
The Renderer is responsible for loading and rendering scenes and managing related WebGPU-specific tasks.
pdb is the file format used by RCSB protein data bank. We only support files with explicit CONECT
instructions.
mmCIF is meant to be the more modern replacement for pdb files. We recommend to convert mmCIF files to pdb instead of relying on our own parser implementation.
Utility for writing buffers to the GPU. Automatically applies required padding and alignment.
Our custom mini framework makes working with WebGPU easier. It wraps around the WebGPU api and provides a more user-friendly interface for creating geomerty and shaders and loading data on the GPU.
Takes the positions of the atoms and calculates a signed distance field texture. To speed up the process considerably, the calculations are performed in a compute shader. This texture is used in the ray-marching shader to render the surface of the molecule.
Primarily renders the moleucle surface with raymarchign and a 3D Sigend distanced field. Also applies the different effects like subsurface scattering, transaprency or reflections.