mrdoob/three.js — Issue #697: Dirty refactoring?
Author: alteredq
Created: 2011-10-28 21:46:53+00:00
State: open

I think `__dirtyXXX` properties definitely proved to be useful and it's time to finally graduate them from hackily exposing WebGLRenderer's internals into something looking more like API.

We could make them lose underscores:

```javascript
geometry.dirtyVertices = false;
geometry.dirtyMorphTargets = false;
geometry.dirtyElements = false;
geometry.dirtyUvs = false;
geometry.dirtyNormals = false;
geometry.dirtyColors = false;
geometry.dirtyTangents = false;
```

Or they could be more in line with textures and custom attributes:

```javascript
geometry.needsUpdateVertices = true;
geometry.needsUpdateElements = true;
geometry.needsUpdateMorphTargets = true;
geometry.needsUpdateUvs = true;
geometry.needsUpdateNormals = true;
geometry.needsUpdateColors = true;
geometry.needsUpdateTangents = true;
```

A bit different variant:

```javascript
geometry.verticesNeedUpdate = true;
geometry.elementsNeedUpdate = true;
geometry.morphTargetsNeedUpdate = true;
geometry.uvsNeedUpdate = true;
geometry.normalsNeedUpdate = true;
geometry.colorsNeedUpdate = true;
geometry.tangentsNeedUpdate = true;
```

What do you think?