-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GLTF to Raster #6
Comments
Something else to consider is the glViewport needs to have the resolution of the target raster. However the model bounds based on the input vertices will likely not have the same mapping. For my test the source is 2000 x 2000. The model vertices need to be transformed to map to these bounds to generate the same output for the ground plane. However the elevation needs to remain the same. |
Updated the argument parser to remove some internally set variables and added geospatial params. Created vertexRasterShaderSource to handle the vertex transformations. tx = (vx - vertMinX) /(vertMaxX - vertMinX) * winX |
The following orthographic projection sets up the correct rendering region. glOrtho(0, argParams.targetWidth, 0, -argParams.targetHeight, -maxY, -minY); |
What currently works:
To Do:
|
Current command
|
The 3d tile JSON file has the LLA geospatial bounds so we can use that to create the initial ROI and then determine spacing. Think like WCS coverage call. Then ECEF to LLA |
The root JSON bounds for the 0/0/0/0/json file. Note it is in the format minX, minY, maxX, maxY, minZ, maxZ with the X and Y in radians. "boundingVolume":{
"region":[
-0.7853981633974483,
-0.5406359802559503,
0.7853981633974483,
0.785398163381105,
-10170.587093897164,
5874.600580642931
]
} Degrees:
|
Current test for framebuffer output with shader files.
Windows test with shader files
|
The JSON file is loaded during argument parsing and at the end updates the values. The mode and the presence JSON content indicates the code path. The vertex program is the ECEF2LLA conversion while the fragment program just writes the altitude to the red channel. |
Converted shaders for GL 3.3. Need to fix ECEF shaders as outputs are currently empty. |
Look at cesium-native Cesium3DTilesSelection::GltfContent line 420. |
The solution for the cartographic coordinates is to first apply the GLTF node transform and then apply the following: 1 0 0 0 (https://github.com/CesiumGS/3d-tiles/blob/main/specification/README.md#transforms)[See implementation note). Still issues with Z coord. |
Currently Excel and shader results agree for transforming the GLTF ECEF to correct ECEF. Excel and web ECEF->LLA calculator agree for final result but I need to check why all points are clipped out when using transformed ECEF -> LLA in shader. |
Removed the JSON requirement for tile 3d since parsing the files gets a complicated for some child nodes. Instead added a -cartoBounds parameter as (minX,maxX,minY,maxY,minZ,maxZ). |
Working command
|
Currently able to load the GLTF / GLB and render using a glOrtho based on the model bounds and essentially a passthrough for the shaders using the original POSITION vertex data.
Currently the test GLB file was generated as Geotiff->Unreal->mesh->FBX->Blender->GLB.
Issues:
To Dos:
The text was updated successfully, but these errors were encountered: