it would be great to have it.
Camera projection
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
Re: Camera projection
Omid Ghotbi (TAO)
Last update information
viewtopic.php?p=34390#p34390
My Artstation https://www.artstation.com/omidghotbi
My Instagram https://www.instagram.com/omid.ghotbi
Last update information
viewtopic.php?p=34390#p34390
My Artstation https://www.artstation.com/omidghotbi
My Instagram https://www.instagram.com/omid.ghotbi
Re: Camera projection
I added the support for camera projection UV shape. The UV of a mesh can be computed with the following syntax:
This is a normal UV rendering:
And this is a mera projection UV rendering:
Note: the UVs are (pre-)computed at vertices so UV interpolation is done in screen space and not in world space. This means large triangles can introduce texture image deformation.
Code: Select all
scene.shapes.obj_shell_src.type = mesh
scene.shapes.obj_shell_src.ply = scenes/luxball/luxball-shell.ply
##
scene.shapes.obj_shell.type = cameraprojuv
scene.shapes.obj_shell.source = obj_shell_src
scene.shapes.obj_shell.uvindex = 0
And this is a mera projection UV rendering:
Note: the UVs are (pre-)computed at vertices so UV interpolation is done in screen space and not in world space. This means large triangles can introduce texture image deformation.
Re: Camera projection
Amazing, I'll give it a try tonight.Dade wrote: ↑Thu Jul 22, 2021 9:57 am I added the support for camera projection UV shape. The UV of a mesh can be computed with the following syntax:
This is a normal UV rendering:Code: Select all
scene.shapes.obj_shell_src.type = mesh scene.shapes.obj_shell_src.ply = scenes/luxball/luxball-shell.ply ## scene.shapes.obj_shell.type = cameraprojuv scene.shapes.obj_shell.source = obj_shell_src scene.shapes.obj_shell.uvindex = 0
i1.jpg
And this is a mera projection UV rendering:
i2.jpg
Note: the UVs are (pre-)computed at vertices so UV interpolation is done in screen space and not in world space. This means large triangles can introduce texture image deformation.
Omid Ghotbi (TAO)
Last update information
viewtopic.php?p=34390#p34390
My Artstation https://www.artstation.com/omidghotbi
My Instagram https://www.instagram.com/omid.ghotbi
Last update information
viewtopic.php?p=34390#p34390
My Artstation https://www.artstation.com/omidghotbi
My Instagram https://www.instagram.com/omid.ghotbi
Re: Camera projection
I test it and it is working as it is supposed to, just one thing that I do not know how to implement is how to use one camera as camera projection and render the image through another camera.Dade wrote: ↑Thu Jul 22, 2021 9:57 am I added the support for camera projection UV shape. The UV of a mesh can be computed with the following syntax:
This is a normal UV rendering:Code: Select all
scene.shapes.obj_shell_src.type = mesh scene.shapes.obj_shell_src.ply = scenes/luxball/luxball-shell.ply ## scene.shapes.obj_shell.type = cameraprojuv scene.shapes.obj_shell.source = obj_shell_src scene.shapes.obj_shell.uvindex = 0
i1.jpg
And this is a mera projection UV rendering:
i2.jpg
Note: the UVs are (pre-)computed at vertices so UV interpolation is done in screen space and not in world space. This means large triangles can introduce texture image deformation.
Let say we have two cameras, Cam1 that should be used as a camera projection map as the first camera and Cam2 that I want to use as actual render view.
Omid Ghotbi (TAO)
Last update information
viewtopic.php?p=34390#p34390
My Artstation https://www.artstation.com/omidghotbi
My Instagram https://www.instagram.com/omid.ghotbi
Last update information
viewtopic.php?p=34390#p34390
My Artstation https://www.artstation.com/omidghotbi
My Instagram https://www.instagram.com/omid.ghotbi
Re: Camera projection
if there are more cameras maybe ask the user what camera should be used at about the same place where the setting is and the default is just the camera that is usedTAO wrote: ↑Sat Jul 24, 2021 10:24 amI test it and it is working as it is supposed to, just one thing that I do not know how to implement is how to use one camera as camera projection and render the image through another camera.Dade wrote: ↑Thu Jul 22, 2021 9:57 am I added the support for camera projection UV shape. The UV of a mesh can be computed with the following syntax:
This is a normal UV rendering:Code: Select all
scene.shapes.obj_shell_src.type = mesh scene.shapes.obj_shell_src.ply = scenes/luxball/luxball-shell.ply ## scene.shapes.obj_shell.type = cameraprojuv scene.shapes.obj_shell.source = obj_shell_src scene.shapes.obj_shell.uvindex = 0
i1.jpg
And this is a mera projection UV rendering:
i2.jpg
Note: the UVs are (pre-)computed at vertices so UV interpolation is done in screen space and not in world space. This means large triangles can introduce texture image deformation.
Let say we have two cameras, Cam1 that should be used as a camera projection map as the first camera and Cam2 that I want to use as actual render view.
Re: Camera projection
There is only one single camera currently in LuxCore. The need of multiple camera definitions has never come up until now.
Re: Camera projection
That's no longer a camera projection though.
It's more a rotated planar projection (if we assume Cam1 is an orthographic camera).
By the way it's not clear to me why this needs to be implemented as a shape. Cycles does this stuff without baking it into the mesh vertices.
Re: Camera projection
In 3dsmax and maya it bakes in mesh UV through modifier same as Dade describe it and of course can be remove from modifier stack in anytime, so it can be used directlly like normal UV.B.Y.O.B. wrote: ↑Sat Jul 24, 2021 4:03 pmThat's no longer a camera projection though.
It's more a rotated planar projection (if we assume Cam1 is an orthographic camera).
By the way it's not clear to me why this needs to be implemented as a shape. Cycles does this stuff without baking it into the mesh vertices.
But any other solution can work here, as far as at least one camera can be used for projection map and the others for render view.
Omid Ghotbi (TAO)
Last update information
viewtopic.php?p=34390#p34390
My Artstation https://www.artstation.com/omidghotbi
My Instagram https://www.instagram.com/omid.ghotbi
Last update information
viewtopic.php?p=34390#p34390
My Artstation https://www.artstation.com/omidghotbi
My Instagram https://www.instagram.com/omid.ghotbi
Re: Camera projection
Bake has no rendering cost: back projecting the point for each ray intersection with such material/texture is far more expansive. The draw back is the one I explained in my note.B.Y.O.B. wrote: ↑Sat Jul 24, 2021 4:03 pm That's no longer a camera projection though.
It's more a rotated planar projection (if we assume Cam1 is an orthographic camera).
By the way it's not clear to me why this needs to be implemented as a shape. Cycles does this stuff without baking it into the mesh vertices.
BTW, actually, it is possible to use multiple cameras: you create the object with Cam1, than edit the scene to redefine the camera as Cam2 and you will obtain the desired result. The object is backed with Cam1 but the rendering will use Cam2.
Re: Camera projection
Updating a scene is one solution, but i think having support for multiple camera at leat 2 camera is far more better solution, imagine that camera projection moving through the time, for each frame scene should be translate and again update after that to be able to render correctlly.Dade wrote: ↑Sat Jul 24, 2021 8:20 pmBake has no rendering cost: back projecting the point for each ray intersection with such material/texture is far more expansive. The draw back is the one I explained in my note.B.Y.O.B. wrote: ↑Sat Jul 24, 2021 4:03 pm That's no longer a camera projection though.
It's more a rotated planar projection (if we assume Cam1 is an orthographic camera).
By the way it's not clear to me why this needs to be implemented as a shape. Cycles does this stuff without baking it into the mesh vertices.
BTW, actually, it is possible to use multiple cameras: you create the object with Cam1, than edit the scene to redefine the camera as Cam2 and you will obtain the desired result. The object is backed with Cam1 but the rendering will use Cam2.
Also having multiple camera is good for multi camera render session too, so we can have as many camera as we want and a flag to decide which one need to be render, so it will be no need for sending another scene to render qeue and just simplly change the camera flag. of course this is a different feature but it can be considered if multiple camera feature is avilable.
Omid Ghotbi (TAO)
Last update information
viewtopic.php?p=34390#p34390
My Artstation https://www.artstation.com/omidghotbi
My Instagram https://www.instagram.com/omid.ghotbi
Last update information
viewtopic.php?p=34390#p34390
My Artstation https://www.artstation.com/omidghotbi
My Instagram https://www.instagram.com/omid.ghotbi