{"author_link":"\/users\/madrededios","author_name":"MadreDeDios","author_uid":"madrededios","comments":[],"epoch":1543958158,"event":"LD43","format":"md","ldjam_node_id":135211,"likes":2,"metadata":{"p_key":"125879","p_author":"MadreDeDios","p_authorkey":"1037512","p_urlkey":"341994","p_title":"Perspectives in a Card Game","p_cat":"LDJam ","p_event":"LD43","p_time":"1543958158","p_likes":"2","p_comments":"0","p_status":"WAYBACK","us_key":"1037512","us_name":"MadreDeDios","us_username":"madrededios","event_start":"1543536000","event_key":"71","event_name":"LD 43"},"node":{"_collation":{"body_sanitizer":"TextUtils::SanitizeHTML via existing importer","event":"LD43","removed_author":false},"_superparent":120415,"_trust":4,"author":37512,"body":"I wanted to avoid creating 2D digital designs for the table and the background of my game (I'm no artist...). So I've decided to make it 3D.\n\nI wasn't convinced by the look of an orthographic camera so I went with a narrow FOV perspective camera.\n![Unity_2018-12-04_12-28-06.png](\/\/\/raw\/882\/9\/z\/1ea8b.png)\n\nBut now that my cards are 3D objects, how can I make sure they don't intersect with the table when flipping?\n![Unity_2018-12-04_12-31-10.png](\/\/\/raw\/882\/9\/z\/1ea94.png)\n\nI used two cameras for that:\n![Unity_2018-12-04_12-32-45.png](\/\/\/raw\/882\/9\/z\/1ea98.png)\nAfter setting the environment on a separate layer, I simply had to set the first camera's _Culling Mask_ to the Environment layer only, and its _Depth_ to 0. The main camera has the Environment excluded from its _Culling Mask_, _Clear Flags_ to _Depth Only_ and its _Depth_ to 1!\n\n**WebGL**  \nWhen porting to WebGL, it was no longer possible to handle that feature. The number of cameras being limited to one, the environment wasn't rendering.  \nSo I had a more traditional camera sitting in the scene, and if I detect the platform to be WebGL, I just turn this camera on and the others off!\n\n![Unity_2018-12-04_12-39-27.png](\/\/\/raw\/882\/9\/z\/1eab0.png)","comments":1,"comments-timestamp":"2018-12-04T21:30:26Z","created":"2018-12-04T12:23:27Z","files":[],"files-timestamp":0,"id":135211,"love":2,"love-timestamp":"2018-12-04T21:30:29Z","meta":[],"modified":"2018-12-04T21:30:29Z","name":"Perspectives in a Card Game","node-timestamp":"2018-12-04T21:15:58Z","parent":125778,"parents":[1,5,9,120415,125778],"path":"\/events\/ludum-dare\/43\/sacrifice-the-card-game\/perspectives-in-a-card-game","published":"2018-12-04T21:15:58Z","scope":"public","slug":"perspectives-in-a-card-game","subsubtype":"","subtype":"","type":"post","version":405629},"node_metadata":{"n_key":"135211","n_urlkey":"341994","n_parent":"125778","n_path":"\/events\/ludum-dare\/43\/sacrifice-the-card-game\/perspectives-in-a-card-game","n_slug":"perspectives-in-a-card-game","n_type":"post","n_subtype":"","n_subsubtype":"","n_author":"37512","n_created":"1543926207","n_modified":"1543959029","n_version":"405629","n_status":"WAYBACK"},"source_url":"https:\/\/ldjam.com\/events\/ludum-dare\/43\/sacrifice-the-card-game\/perspectives-in-a-card-game","text":"I wanted to avoid creating 2D digital designs for the table and the background of my game (I'm no artist...). So I've decided to make it 3D.\n\nI wasn't convinced by the look of an orthographic camera so I went with a narrow FOV perspective camera.\n![Unity_2018-12-04_12-28-06.png](\/\/\/raw\/882\/9\/z\/1ea8b.png)\n\nBut now that my cards are 3D objects, how can I make sure they don't intersect with the table when flipping?\n![Unity_2018-12-04_12-31-10.png](\/\/\/raw\/882\/9\/z\/1ea94.png)\n\nI used two cameras for that:\n![Unity_2018-12-04_12-32-45.png](\/\/\/raw\/882\/9\/z\/1ea98.png)\nAfter setting the environment on a separate layer, I simply had to set the first camera's _Culling Mask_ to the Environment layer only, and its _Depth_ to 0. The main camera has the Environment excluded from its _Culling Mask_, _Clear Flags_ to _Depth Only_ and its _Depth_ to 1!\n\n**WebGL**  \nWhen porting to WebGL, it was no longer possible to handle that feature. The number of cameras being limited to one, the environment wasn't rendering.  \nSo I had a more traditional camera sitting in the scene, and if I detect the platform to be WebGL, I just turn this camera on and the others off!\n\n![Unity_2018-12-04_12-39-27.png](\/\/\/raw\/882\/9\/z\/1eab0.png)","title":"Perspectives in a Card Game","wayback_source":[]}