Skip to content

Commit

Permalink
bugfixes, half fps mode for bookmark
Browse files Browse the repository at this point in the history
batch rendering #214
  • Loading branch information
RebeccaNowak committed Jul 28, 2022
1 parent 6021522 commit 3e0690f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 26 deletions.
1 change: 1 addition & 0 deletions src/PRo3D.Core/SequencedBookmarks/SequencedBookmarksApp.fs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ module SequencedBookmarksApp =
| StartRecording ->
outerModel, {m with
savedTimeSteps = []
lastSavedBookmark = None
isRecording = true
currentFps = None
}
Expand Down
1 change: 1 addition & 0 deletions src/PRo3D.SimulatedViews/Snapshots/Snapshot.fs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ module Snapshot =
}
steps
|> List.map toSnapshot



/// Creates snapshots based on camera views.
Expand Down
19 changes: 18 additions & 1 deletion src/PRo3D.SimulatedViews/Snapshots/SnapshotAnimation.fs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,24 @@ module SnapshotAnimation =
if bm.savedTimeSteps.Length > 0 then
let snapshots =
Snapshot.fromTimeSteps bm.savedTimeSteps
//TODO RNO bm.fpsSetting

let snapshots =
match bm.fpsSetting with
| FPSSetting.Full ->
snapshots
| FPSSetting.Half ->
let filtered =
snapshots
|> List.indexed
|> List.filter (fun (i, x) -> match x.transformation with
| BookmarkTransformation.Bookmark bm -> true
| BookmarkTransformation.Camera cam -> (i % 2) = 1
)
|> List.map snd
|> List.indexed
|> List.map (fun (i, x) -> {x with filename = sprintf "%06i%s" i (x.filename.Substring 6)} )
filtered
| _ -> snapshots

let snapshotAnimation : BookmarkSnapshotAnimation =
{
Expand Down
26 changes: 1 addition & 25 deletions src/PRo3D.Snapshots/Viewer/SnapshotGenerator.fs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ module SnapshotGenerator =
| Some state ->
[
ViewerAction.SetSceneState state
ViewerAction.SetCamera bookmark.cameraView
]
| None -> []
actions
Expand Down Expand Up @@ -162,31 +163,6 @@ module SnapshotGenerator =
}
SnapshotApp.executeAnimation snapshotApp
| Some (SnapshotAnimation.BookmarkAnimation data) ->
//let foV =
// match data.fieldOfView with
// | Some fov -> fov
// | None -> SnapshotApp.defaultFoV

//let foV =
// match data.fieldOfView with
// | Some fov -> fov
// | None ->
// Log.line "[Snapshots] Using default field of view: %f" SnapshotApp.defaultFoV
// SnapshotApp.defaultFoV
//let firstBookmark = BookmarkSnapshotAnimation.tryFirst data
//let firstBookmark =
// match firstBookmark with
// | Some firstBookmark -> firstBookmark
// | None -> failwith "[Snapshots] The first transformation of a bookmark animation has to be a bookmark."
//let sceneState =
// match firstBookmark.sceneState with
// | Some state -> state
// | None ->

//let frustum =
// Frustum.perspective foV near far
// (float(resolution.X)/float(resolution.Y))

let sg = SnapshotSg.viewRenderView runtime (System.Guid.NewGuid().ToString())
(AVal.constant data.resolution) mModel
let snapshotApp =
Expand Down

0 comments on commit 3e0690f

Please sign in to comment.