Forum

#1 2016-12-21 12:21:15

Shioon
Member

How to list all element seen by the camera

Hello,

Like it mean in the title, I would like to know if there is a way to select/list all element seen in the camera in lua or python.


Jeremy TAN
TD Junior chez OnyxLux3D

Offline

 

#2 2016-12-22 13:21:25

Ben
Guerilla dev, the guy to hug

Re: How to list all element seen by the camera

Hi Shioon,

This is quite not trivial, like dealing with instances, etc.
What do you have in mind? Like removing non directly visible objects? If so, what about shadows, indirect diffuse and reflections?

Ben


Benjamin 'Ben' Legros
Guerilla developer
http://www.guerillarender.com

Offline

 

#3 2016-12-22 14:48:33

Shioon
Member

Re: How to list all element seen by the camera

For now, they just want to list all Character seen by the camera to bake just these Character.


Jeremy TAN
TD Junior chez OnyxLux3D

Offline

 

#4 2016-12-22 17:31:49

hulud
Guerilla dev, the guy to hug

Re: How to list all element seen by the camera

So you want to do that in Maya, before baking the alembic, right ?


Cyril 'Hulud' Corvazier
Guerilla developer
http://www.mercs-eng.com

Offline

 

#5 2016-12-23 10:38:31

Shioon
Member

Re: How to list all element seen by the camera

I have another precision, they want to bake the procedural fur in guerrilla just for the Characters seen in the scene (and maybe yeti but i'm not sure currently).
For now they already have exported  75% of the movie. and they don't have time to re-export them again.


Jeremy TAN
TD Junior chez OnyxLux3D

Offline

 

#6 2016-12-23 10:58:20

hulud
Guerilla dev, the guy to hug

Re: How to list all element seen by the camera

Ok it makes sense.

To do that, you have to build the 6 camera clipping planes and test them against the character world space bounding box.

You can get the world space bounding box using the Guerilla SDK, but not the camera clipping planes. You will have to craft them :

First you have to build the 8 points of the camera frustum using the camera matrix, the camera Fov, the camera near/far and the aspect ratio of the image.

    4 ----- 5
    |\       |
    | 0 --- 1
    | 3 --- 2
    |/       |
    7 ----- 6

Once you have those 8 points, you can build the 6 clipping planes of your camera. Then, you will have to test the character box against those planes : if the 8 vertices of the box are in front of one of the clipping planes, the object is not visible. Don't forget to extend the object box a little bit.

If it's too complex to do, just tell me, I'll try to schedule that.


Cyril 'Hulud' Corvazier
Guerilla developer
http://www.mercs-eng.com

Offline

 

#7 2017-01-02 11:37:58

Shioon
Member

Re: How to list all element seen by the camera

Thanks Cyril,

I'll look about it and surely I'll ask you other question about it.


Jeremy TAN
TD Junior chez OnyxLux3D

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2008 PunBB