Skip to content

Commit

Permalink
fixed Effect-IDs avoiding wrong cache-hits
Browse files Browse the repository at this point in the history
  • Loading branch information
aardvark-platform committed Oct 21, 2024
1 parent ed86f48 commit 9d1448c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 1.0.5
* fixed Effect-IDs avoiding wrong cache-hits

### 1.0.4
* SceneHandler now used RGBA32F for rendering Pick Information (better compatibility)

Expand Down
10 changes: 5 additions & 5 deletions src/Aardvark.Dom/SceneGraph/SceneHandler.fs
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ module internal PickShader =
let pickId(v : Vertex) =
fragment {
let n32 = Normal32.encode (Vec.normalize v.vn) |> int
let d = (2.0 * v.d - 1.0) |> Bitwise.FloatBitsToInt
return { c = v.c; id = V4d(Bitwise.IntBitsToFloat uniform.PickId, Bitwise.IntBitsToFloat n32, Bitwise.IntBitsToFloat d, 0.0) }
let d = (2.0 * v.d - 1.0)
return { c = v.c; id = V4d(Bitwise.IntBitsToFloat uniform.PickId, Bitwise.IntBitsToFloat n32, d, 0.0) }
}

let pickIdNoNormal(v : Vertex) =
fragment {
let n32 = 0
let d = (2.0 * v.d - 1.0) |> Bitwise.FloatBitsToInt
return { c = v.c; id = V4d(Bitwise.IntBitsToFloat uniform.PickId, Bitwise.IntBitsToFloat n32, Bitwise.IntBitsToFloat d, 0.0) }
let d = (2.0 * v.d - 1.0)
return { c = v.c; id = V4d(Bitwise.IntBitsToFloat uniform.PickId, Bitwise.IntBitsToFloat n32, d, 0.0) }
}

let vertexPickEffect = Effect.ofFunction pickVertex
Expand Down Expand Up @@ -762,7 +762,7 @@ type SceneHandler(signature : IFramebufferSignature, trigger : RenderControlEven
newShader.Shaders
)

let newEffect = FShade.Effect("pick_" + eff.Id, newShaders, [])
let newEffect = FShade.Effect("fpick_" + eff.Id, newShaders, [])

let r = RenderObject.Clone o
r.Uniforms <- UniformProvider.union o.Uniforms (UniformProvider.ofList ["PickId", AVal.constant pickId :> IAdaptiveValue])
Expand Down

0 comments on commit 9d1448c

Please sign in to comment.