Author Topic: Global DEM and rotation  (Read 457 times)

Offline edlo

  • Member
  • *
  • Posts: 99
Global DEM and rotation
« on: December 27, 2018, 01:49:31 PM »
Hi there guys.
We have come across something that seems to be kind of a problem.
We have a global DEM of a planet surface mapped perfectly and looking great; then some simple procedural texturing through surface layers, only 4.
Everything cool so far; now the problem is that we need to slightly animate the rotation of the planet, Translate Textures with Planet and Rotate Textures with planet seem to have no effect on the DEM so al features remain static. However we tried animating the Lat Long on the planet settings and there ! fantastic now it moves; kind of a workaround that doesnt give you full control of the positioning with only two values driving this, but hell it moves. Sadly enough we render the sequence just to find out that the textures dont seem to be informed of the surface movement so now those are static against the Terrain moving.
We need to find a solution to rotating averything and matching both texture and DEM terrain features.
Sorry to say that this is a production enviroment so I cant share the file here for you to take a look, but the setup is as simple as I stated DEM -4 surface procedurals- one planet.
Thanks in advance for your help.
ED.

Offline Matt

  • Planetside Staff
  • *
  • Posts: 3583
  • I'm the crazy one
Re: Global DEM and rotation
« Reply #1 on: December 27, 2018, 02:48:46 PM »
You mentioned you tried “Rotate textures with planet” first. It doesn't work for heightfields but it works for most other shaders. Do you still have that enabled and are you rotating the planet?

Some shaders may need to be adjusted to work in texture space rather than world space. If some shaders aren’t responding, let us know which ones.
Just because milk is white doesn't mean that clouds are made of milk.

Offline cyphyr

  • Member
  • *
  • Posts: 4049
    • richardfraser
Re: Global DEM and rotation
« Reply #2 on: December 27, 2018, 02:54:42 PM »
You can rotate the procedural textures with a transform node?
If you have the procedurals plugged into the child of a surface (or distribution) shader you can rotate them "en-masse" with a transform node between the last procedural shader and the surface (or distribution) shader.
You may have to place the planet at 0,0,0 first.
If the planet is tilted (easier to tilt the camera) you will need TWO transform shaders, the first one to tilt, the second to rotate.

Hope this is of some help or at lease illuminates a way forward.
www.richardfraser.co.uk
https://www.facebook.com/RichardFraserVFX/
/|\

i7 5930K @3.5Ghz, 32Gb (TG4 benchmark 13.44)
i7 980 @3.75Ghz, 16Gb (TG4 benchmark 18:40)

Offline edlo

  • Member
  • *
  • Posts: 99
Re: Global DEM and rotation
« Reply #3 on: December 27, 2018, 04:40:00 PM »
You mentioned you tried “Rotate textures with planet” first. It doesn't work for heightfields but it works for most other shaders. Do you still have that enabled and are you rotating the planet?

Some shaders may need to be adjusted to work in texture space rather than world space. If some shaders aren’t responding, let us know which ones.

HI Matt. Thanks for the quick reply.
Precisely, "rotate textures with planet" moves the textures the DEM remains in place.
When we Managed to move the DEM through the Lat Long at apex settings on the planet The motion on the textures does not correspond and trying to match it seems impossible to get.
We also tried moving the textures with the Transform input shader and the DEM with the position settings on the Height-field node itself, but again matching both movements so they dont slide against/different to each other its proving to be unattainable.
We would need a solution which rotates both accurately as we thought the Rotate planet with textures was going to deliver.
We finally have tried to save the DEM as a .ter file yet that only crashes TG
BTW we are on the latest TG 4.3.18
Thanks for your help.
ED.

Offline edlo

  • Member
  • *
  • Posts: 99
Re: Global DEM and rotation
« Reply #4 on: December 27, 2018, 04:46:21 PM »
You can rotate the procedural textures with a transform node?
If you have the procedurals plugged into the child of a surface (or distribution) shader you can rotate them "en-masse" with a transform node between the last procedural shader and the surface (or distribution) shader.
You may have to place the planet at 0,0,0 first.
If the planet is tilted (easier to tilt the camera) you will need TWO transform shaders, the first one to tilt, the second to rotate.

Hope this is of some help or at lease illuminates a way forward.

Hi and thanks for the help.we have tried a similar approach but we will give your exact procedure a try and I will get back to you; however as I explained to Matt matching this to the movement of the DEM would be the tricky part.
Cheers.
ED.

Offline cyphyr

  • Member
  • *
  • Posts: 4049
    • richardfraser
Re: Global DEM and rotation
« Reply #5 on: December 27, 2018, 06:54:58 PM »
Another solution that "may" be easier is if you can load your global dem in to something that will convert it to a bitmap format (16bit tif is good) you could just project is as a spherical texture.
Then you could rotate everything with a transform node or directly with the “Rotate textures with planet”.
Try Global mapper if you have access to it. If the DEM is a GeoTiff you are already there and you can just project it as a spherical texture.
www.richardfraser.co.uk
https://www.facebook.com/RichardFraserVFX/
/|\

i7 5930K @3.5Ghz, 32Gb (TG4 benchmark 13.44)
i7 980 @3.75Ghz, 16Gb (TG4 benchmark 18:40)

Offline edlo

  • Member
  • *
  • Posts: 99
Re: Global DEM and rotation
« Reply #6 on: December 27, 2018, 07:34:33 PM »
Another solution that "may" be easier is if you can load your global dem in to something that will convert it to a bitmap format (16bit tif is good) you could just project is as a spherical texture.
Then you could rotate everything with a transform node or directly with the “Rotate textures with planet”.
Try Global mapper if you have access to it. If the DEM is a GeoTiff you are already there and you can just project it as a spherical texture.

Sounds like a nice approach thanks a bunch; however if I manage to load it, its an 8.98 GB geo Tiff (fingers crossed) Im afraid of loosing the exquisite detail the DEM its giving me at this point.
Keep you posted.
ED.


UPDATE: Sadly the geo tiff does not load as a spherical texture TG crashes on the attempt
« Last Edit: December 27, 2018, 08:41:23 PM by edlo »

Offline cyphyr

  • Member
  • *
  • Posts: 4049
    • richardfraser
Re: Global DEM and rotation
« Reply #7 on: December 27, 2018, 10:06:59 PM »
Could you try just using half the geoTiff?, the half facing the camera.
www.richardfraser.co.uk
https://www.facebook.com/RichardFraserVFX/
/|\

i7 5930K @3.5Ghz, 32Gb (TG4 benchmark 13.44)
i7 980 @3.75Ghz, 16Gb (TG4 benchmark 18:40)

Offline Matt

  • Planetside Staff
  • *
  • Posts: 3583
  • I'm the crazy one
Re: Global DEM and rotation
« Reply #8 on: December 27, 2018, 11:21:38 PM »
I will attempt to get planet rotation working with DEMs in the next update. How urgently do you need this and which platforms do you need it to work on?

If you need a solution that works in the current version, the level of difficulty depends on the axis of rotation, what your current lat-long values are, and how flexible you are about changing these things. If possible, please share your setup with us privately to the support email.
Just because milk is white doesn't mean that clouds are made of milk.

Offline edlo

  • Member
  • *
  • Posts: 99
Re: Global DEM and rotation
« Reply #9 on: December 28, 2018, 12:25:14 PM »
I will attempt to get planet rotation working with DEMs in the next update. How urgently do you need this and which platforms do you need it to work on?

If you need a solution that works in the current version, the level of difficulty depends on the axis of rotation, what your current lat-long values are, and how flexible you are about changing these things. If possible, please share your setup with us privately to the support email.

Hi Matt
We are in production of this so the time we need it is ASAP We already have other animated assets placed in this shot and the camera and layout have been approved so changing anything at this point would be quite difficult This is being tried in Maya yet without the beautiful results from TG which I have been championing; but the thing rotates in Maya which is what they want. Will have to clear sharing the file with you with the higher powers would you be ok signing an NDA and using your direct email for this?.
Cheers.
ED.

Offline edlo

  • Member
  • *
  • Posts: 99
Re: Global DEM and rotation
« Reply #10 on: December 28, 2018, 12:27:45 PM »
Could you try just using half the geoTiff?, the half facing the camera.

I managed to reduce the tiff to a size that doesnt crash TG 4.4 GB; yet what I was afraid of the detail its not the same, not close to what we need.
Thanks a bunch.
ED.

Offline cyphyr

  • Member
  • *
  • Posts: 4049
    • richardfraser
Re: Global DEM and rotation
« Reply #11 on: December 28, 2018, 03:01:48 PM »
I don't mean half the size as such, I mean using only half of the original image so the detail stays the same.
A spherical projection is normally in the ratio of 2:1(2048 x 1024 for example).
I am suggesting using a crop of your original image at 1:1 (1024:1024) and use spherical projection planet cantered at 0,0,0 and the size set to x= 0.5 and y=1.


Basically if the planet is only rotating a small amount there is no point loading data that is not seen by the camera.
www.richardfraser.co.uk
https://www.facebook.com/RichardFraserVFX/
/|\

i7 5930K @3.5Ghz, 32Gb (TG4 benchmark 13.44)
i7 980 @3.75Ghz, 16Gb (TG4 benchmark 18:40)

Offline Matt

  • Planetside Staff
  • *
  • Posts: 3583
  • I'm the crazy one
Re: Global DEM and rotation
« Reply #12 on: December 31, 2018, 12:45:07 PM »
Ed, can you try loading your DEM into a Geog Image Map Shader instead of Geog Heightfield Load? That should respond to the rotation, and I believe it will work with all the same formats. Geog Image Map Shader has displacement capabilities.
Just because milk is white doesn't mean that clouds are made of milk.

Offline edlo

  • Member
  • *
  • Posts: 99
Re: Global DEM and rotation
« Reply #13 on: January 02, 2019, 02:04:02 PM »
Ed, can you try loading your DEM into a Geog Image Map Shader instead of Geog Heightfield Load? That should respond to the rotation, and I believe it will work with all the same formats. Geog Image Map Shader has displacement capabilities.

Hi Matt.
Thanks I will try this and get back to you.
Cheers.

UPDATE: It loads, and it rotates, however all the detail from the DEM its not there anymore. The displacement only shows a fraction of the detail contained in the 8 GB Geo tiff.
« Last Edit: January 02, 2019, 03:47:18 PM by edlo »