Skip to content

Commit

Permalink
Fixed depth
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroHG committed Nov 22, 2024
1 parent 338522b commit 0d51b19
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
12 changes: 9 additions & 3 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,8 @@ def ci_build(
novelty_thor_scenes=False,
skip_delete_tmp_dir=False, # bool
cloudrendering_first=False,
only_cloudrendering=False
only_cloudrendering=False,
private_scenes_skip=False
):
assert (commit_id is None) == (
branch is None
Expand Down Expand Up @@ -1159,14 +1160,19 @@ def ci_build(
# disabling delete temporarily since it interferes with pip releases
# pytest_s3_object(build["commit_id"]).delete()
logger.info(f"pending build for {build['branch']} {build['commit_id']}")

if not private_scenes_skip:
novelty_thor_scenes = False
private_repos = []

clean(private_repos=private_repos)
private_scene_options = [novelty_thor_scenes]

subprocess.check_call("git fetch", shell=True)
subprocess.check_call("git checkout %s --" % build["branch"], shell=True)
logger.info(f" After checkout")
subprocess.check_call("git checkout -qf %s" % build["commit_id"], shell=True)

private_scene_options = [novelty_thor_scenes]

build_archs = ["OSXIntel64"] # , "Linux64"]
build_archs = [] if only_cloudrendering else ["OSXIntel64"] # , "Linux64"]

Expand Down
6 changes: 2 additions & 4 deletions unity/Assets/Scripts/CapturePass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ public class CaptureConfig {

public string shaderName;

public ReplacelementMode replacementMode;

public int? toDisplay = 0;

public bool cloudRendering;
Expand Down Expand Up @@ -450,9 +448,9 @@ public class ReplacementShaderCapture: RenderToTexture {

private readonly Transform cameraParent;
private ReplacelementMode mode;
public ReplacementShaderCapture(CaptureConfig config, Transform cameraParent) : base(config, null) {
public ReplacementShaderCapture(CaptureConfig config, ReplacelementMode replacementMode, Transform cameraParent) : base(config, null) {
this.cameraParent = cameraParent;
this.mode = config.replacementMode;
this.mode = replacementMode;
}

public override void OnInitialize(Camera mainCamera) {
Expand Down
15 changes: 8 additions & 7 deletions unity/Assets/Scripts/RenderingManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ public class RenderingManager : MonoBehaviour {

private Texture2D readTex;

private static bool isMainCameraPassCreated = false;

public RenderToTexture distortionMap {
get;
private set;
Expand Down Expand Up @@ -166,7 +164,7 @@ void Awake() {


var depthPass = new RenderToTexture(
new CaptureConfig() { name = "_depth", antiAliasLevel = antiAliasLevel, shaderName = "Hidden/DepthBW" },
new CaptureConfig() { name = "_depth", antiAliasLevel = antiAliasLevel, shaderName = "Hidden/DepthBW", renderTextureFormat = RenderTextureFormat.RFloat },
camera: camera
);

Expand All @@ -176,17 +174,20 @@ void Awake() {
);

var idPass = new ReplacementShaderCapture(
new CaptureConfig() { name = "_id", antiAliasLevel = antiAliasLevel, shaderName = "Hidden/UberReplacement", replacementMode = ReplacelementMode.ObjectId },
new CaptureConfig() { name = "_id", antiAliasLevel = antiAliasLevel, shaderName = "Hidden/UberReplacement" },
replacementMode: ReplacelementMode.ObjectId,
cameraParent: camera.transform
);

var classPass = new ReplacementShaderCapture(
new CaptureConfig() { name = "_class", antiAliasLevel = antiAliasLevel, shaderName = "Hidden/UberReplacement", replacementMode = ReplacelementMode.CatergoryId },
new CaptureConfig() { name = "_class", antiAliasLevel = antiAliasLevel, shaderName = "Hidden/UberReplacement" },
replacementMode: ReplacelementMode.CatergoryId,
cameraParent: camera.transform
);

var normalsPass = new ReplacementShaderCapture(
new CaptureConfig() { name = "_normals", antiAliasLevel = antiAliasLevel, shaderName = "Hidden/UberReplacement", replacementMode = ReplacelementMode.Normals },
new CaptureConfig() { name = "_normals", antiAliasLevel = antiAliasLevel, shaderName = "Hidden/UberReplacement" },
replacementMode: ReplacelementMode.Normals,
cameraParent: camera.transform
);

Expand All @@ -197,7 +198,7 @@ void Awake() {
// make first _img capture created render to Display
int? toDisplay = null;
this.mainPass = new MultiCapture(
config: new CaptureConfig() { name = "_img", antiAliasLevel = antiAliasLevel, cloudRendering = cloudRenderingCapture, toDisplay = isMainCameraPassCreated ? toDisplay : 0},
config: new CaptureConfig() { name = "_img", antiAliasLevel = antiAliasLevel, cloudRendering = cloudRenderingCapture, toDisplay = IsMainCamera ? 0 : toDisplay},
camera: camera,
passes: new List<RenderToTexture>() {
}
Expand Down

0 comments on commit 0d51b19

Please sign in to comment.