Commit graph

1381 commits

Author SHA1 Message Date
Vsevolod Kremianskii
2113d13a0d Use Bezier curves for emitter constraints 2021-05-18 08:37:04 +07:00
Vsevolod Kremianskii
fc32d64642 Revert StateManager to stateutil
It's just easier to use that way.
2021-05-18 06:01:05 +07:00
Vsevolod Kremianskii
81bf3dfeaf Take emitters spread value into account 2021-05-16 15:16:46 +07:00
Vsevolod Kremianskii
8aa5ee92ca Fix particle animation 2021-05-16 14:34:08 +07:00
Vsevolod Kremianskii
c4985f8684 Disable back-face culling for particles, grass and etc. 2021-05-16 14:08:25 +07:00
Vsevolod Kremianskii
81349e79f0 Fix loading anim node controllers 2021-05-16 13:47:30 +07:00
Vsevolod Kremianskii
b7c93cb9fa Do not crash on Bezier float controllers 2021-05-16 13:33:30 +07:00
Vsevolod Kremianskii
ed0e1d4809 Extract normal and shadow mapping into a separate shader source 2021-05-16 13:14:45 +07:00
Vsevolod Kremianskii
a937fab08b Use prefix "s" for sampler uniforms 2021-05-16 13:03:36 +07:00
Vsevolod Kremianskii
5f290bc18b Check center of AABB as part of frustum culling 2021-05-16 12:48:31 +07:00
Vsevolod Kremianskii
34c7764ef3 Separate bump maps from normal maps on shader level 2021-05-16 11:52:35 +07:00
Vsevolod Kremianskii
5ab41db41c Fix animation blending
- Take channel freeze into account
- Clear other channels when initiating animation in Blend mode
2021-05-16 09:47:43 +07:00
Vsevolod Kremianskii
9e28de7041 Drop support for swizzled normal maps 2021-05-16 09:11:28 +07:00
Vsevolod Kremianskii
bb2b5b255b Move bone map to boneNodeName conversion to MdlReader 2021-05-16 09:07:03 +07:00
Vsevolod Kremianskii
5fce19c95b Take animations in Model ctor 2021-05-16 08:38:35 +07:00
Vsevolod Kremianskii
ee09ba6209 Generalize attribute accessors in Mesh 2021-05-16 08:16:34 +07:00
Vsevolod Kremianskii
91643240fd Do not play same animation twice 2021-05-15 16:08:03 +07:00
Vsevolod Kremianskii
5ff803f0aa Use deque, not fixed array for animation channels
Erase finished animation channels.
2021-05-15 16:02:17 +07:00
Vsevolod Kremianskii
2d3540b73f Exclusively use node names to bind animations to model nodes
This both makes for a cleaner API and fixes stunt animations.
2021-05-15 15:13:38 +07:00
Vsevolod Kremianskii
bb9d0e1f41 Make self-illum color influence object color in shaders 2021-05-15 13:52:19 +07:00
Vsevolod Kremianskii
ef5782909f Fix determining reference point for selection and dialog 2021-05-15 13:37:16 +07:00
Vsevolod Kremianskii
30b9f2b40b Recompute model AABB on attachment 2021-05-15 11:52:03 +07:00
Vsevolod Kremianskii
eec6b8e403 Reimplement AABB debugging 2021-05-15 11:45:03 +07:00
Vsevolod Kremianskii
a6c6230e2b Fix loading emitter properties 2021-05-15 11:31:08 +07:00
Vsevolod Kremianskii
62f140454e Remove outdated models diagram
[ci skip]
2021-05-15 11:17:35 +07:00
Vsevolod Kremianskii
3160e177f9 Offset bone matrices by 1 to prevent out of bound access 2021-05-15 10:47:47 +07:00
Vsevolod Kremianskii
5817ba0a79 Revert to reading bone map from MDL
Some models use more than 16 bones per node.
2021-05-15 10:14:59 +07:00
Vsevolod Kremianskii
4c7d588af9 Fix bump mapping
- Use tangent space normals from MDL
- Fix tangent space to world space transform
2021-05-15 09:52:14 +07:00
Vsevolod Kremianskii
5eefe157e7 Make bones influence normals in VS 2021-05-15 08:41:31 +07:00
Vsevolod Kremianskii
e1366255dc Fix loading Size Y emitter property 2021-05-15 07:52:35 +07:00
Vsevolod Kremianskii
bd41b81dc2 Fix CI build 2021-05-15 07:49:42 +07:00
Vsevolod Kremianskii
740440ca78 Major refactoring of the scene management system 2021-05-14 23:31:05 +07:00
Vsevolod Kremianskii
aeffc4b453 Rename ModelNodeSceneNode to MeshSceneNode 2021-05-13 15:16:49 +07:00
Vsevolod Kremianskii
366d8d739d Major graphics/model refactoring
- Decouple Model and ModelNode from MdlReader
- Make Emitter a nested struct under ModelNode
- Read all known controller types
2021-05-13 14:54:23 +07:00
Vsevolod Kremianskii
277a94bec7 Simplify materials
- Remove specular parameter (shininess is enough)
- Explicit default material is removed
- Default roughness is set to 0.5
2021-05-12 12:20:43 +07:00
Vsevolod Kremianskii
4a2c507c0f Swap bone indices and bone weights vertex attributes 2021-05-12 12:09:05 +07:00
Vsevolod Kremianskii
640b5a3c8e Improve grass lightmapping
- Read face materials from MDL
- Use AABB model node, not walkmesh, to create grass clusters
- Use barycentric coordinates to interpolate texture coordinates

While at it, add Mesh methods to draw a subset of triangles.
2021-05-12 12:05:04 +07:00
Vsevolod Kremianskii
d09b53b5c0 Cleanup Mesh class 2021-05-11 23:26:00 +07:00
Vsevolod Kremianskii
2843761be0 Add mesh and texture subdirectories to engine/graphics 2021-05-11 23:05:34 +07:00
Vsevolod Kremianskii
214aded7a4 Refactor ModelMesh
- Make it a struct, given how it doesn't have a behavior
- Place it under ModelNode
2021-05-11 22:25:52 +07:00
Vsevolod Kremianskii
f8ae6c8315 Implicitly calculate vertexCount in Mesh ctor 2021-05-11 20:19:46 +07:00
Vsevolod Kremianskii
854c72a16a Make Mesh independent of MdlReader
Remove friend class.
2021-05-11 20:07:02 +07:00
Vsevolod Kremianskii
0e2ffbee9d Refactor VertexOffsets
- Extract from Mesh
- Rename to VertexAttributes
- Move stride on top
2021-05-11 19:17:34 +07:00
Vsevolod Kremianskii
ebee8f36c6 Drop redundant buffer binding in Mesh 2021-05-11 18:59:28 +07:00
Vsevolod Kremianskii
ad399815b7 Refactor collision detection
- Drop CollisionDetector class as unnecessary abstraction
- Move collision detection code from area.cpp into area_collision.cpp
- Implement sliding along obstacle normals
- Temporarily disable collision between creatures
2021-05-10 21:57:21 +07:00
Vsevolod Kremianskii
235ed4a274 Cleanup collision detection 2021-05-10 16:12:17 +07:00
Vsevolod Kremianskii
e99822ae3c Refactor shadow casters 2021-05-10 12:07:44 +07:00
Vsevolod Kremianskii
200b1ad6d8 Select lights closest to the reference node, not per model
This makes dynamic lighting slighly more performant and improves area
lighting.
2021-05-10 11:55:13 +07:00
Vsevolod Kremianskii
563238fd92 Remove maximum number of lights setting
It is redundant, 8 is an optimal number.
2021-05-10 11:25:21 +07:00
Vsevolod Kremianskii
a902a92d34 Drop exposure setting
Exposure must not be something a user should adjust - proper
exposure must be selected for each scene by an algorithm.
2021-05-10 11:14:20 +07:00