RenderSetup is called by the engine before rendering the scene
(gs *gls.GLS, rinfo *core.RenderInfo, idx int)
| 96 | |
| 97 | // RenderSetup is called by the engine before rendering the scene |
| 98 | func (lp *Point) RenderSetup(gs *gls.GLS, rinfo *core.RenderInfo, idx int) { |
| 99 | |
| 100 | // Calculates light position in camera coordinates and updates uniform |
| 101 | var pos math32.Vector3 |
| 102 | lp.WorldPosition(&pos) |
| 103 | pos4 := math32.Vector4{pos.X, pos.Y, pos.Z, 1.0} |
| 104 | pos4.ApplyMatrix4(&rinfo.ViewMatrix) |
| 105 | lp.udata.position.X = pos4.X |
| 106 | lp.udata.position.Y = pos4.Y |
| 107 | lp.udata.position.Z = pos4.Z |
| 108 | |
| 109 | // Transfer uniform data |
| 110 | const vec3count = 3 |
| 111 | location := lp.uni.LocationIdx(gs, vec3count*int32(idx)) |
| 112 | gs.Uniform3fv(location, vec3count, &lp.udata.color.R) |
| 113 | } |
nothing calls this directly
no test coverage detected