kyleleey commited on
Commit
f9ae7a0
1 Parent(s): 4d9ecb0

update render pytorch3d bones

Browse files
Files changed (1) hide show
  1. video3d/render/render.py +6 -2
video3d/render/render.py CHANGED
@@ -14,6 +14,8 @@ from . import util
14
  from . import renderutils as ru
15
  from . import light
16
 
 
 
17
  # ==============================================================================================
18
  # Helper functions
19
  # ==============================================================================================
@@ -51,7 +53,9 @@ def shade(
51
  perturbed_nrm = None
52
  # Combined texture, used for MLPs because lookups are expensive
53
  # all_tex_jitter = material.sample(gb_tex_pos + torch.normal(mean=0, std=0.01, size=gb_tex_pos.shape, device="cuda"), feat=feat)
54
- if material is not None:
 
 
55
  if im_features_map is None:
56
  all_tex = material.sample(gb_tex_pos, feat=feat)
57
  else:
@@ -87,7 +91,7 @@ def shade(
87
  ################################################################################
88
  # Normal perturbation & normal bend
89
  ################################################################################
90
- if material is None or not material.perturb_normal:
91
  perturbed_nrm = None
92
 
93
  gb_normal = ru.prepare_shading_normal(gb_pos, view_pos, perturbed_nrm, gb_normal, gb_tangent, gb_geometric_normal, two_sided_shading=two_sided_shading, opengl=True, use_python=True)
 
14
  from . import renderutils as ru
15
  from . import light
16
 
17
+ from .texture import Texture2D
18
+
19
  # ==============================================================================================
20
  # Helper functions
21
  # ==============================================================================================
 
53
  perturbed_nrm = None
54
  # Combined texture, used for MLPs because lookups are expensive
55
  # all_tex_jitter = material.sample(gb_tex_pos + torch.normal(mean=0, std=0.01, size=gb_tex_pos.shape, device="cuda"), feat=feat)
56
+ if isinstance(material, Texture2D):
57
+ all_tex = material.sample(gb_texc, gb_texc_deriv)
58
+ elif material is not None:
59
  if im_features_map is None:
60
  all_tex = material.sample(gb_tex_pos, feat=feat)
61
  else:
 
91
  ################################################################################
92
  # Normal perturbation & normal bend
93
  ################################################################################
94
+ if material is None or isinstance(material, Texture2D) or not material.perturb_normal:
95
  perturbed_nrm = None
96
 
97
  gb_normal = ru.prepare_shading_normal(gb_pos, view_pos, perturbed_nrm, gb_normal, gb_tangent, gb_geometric_normal, two_sided_shading=two_sided_shading, opengl=True, use_python=True)