#### Repository [Godot Documentation](https://github.com/godotengine/godot-docs) and [Godot](https://github.com/godotengine/godot) http://docs.godotengine.org/en/latest/_images/planet_example.png *The above picture is included in the tutorial only for demonstration purposes only. It shows the kind of planet look that can be achieved with procedural texture generation. However, the tutorial does not cover how to do the atmospheric scattering effect found in this picture.* #### Details This post arose out of two things: first, I wanted to infuse the Godot documentation with more procedural generation content, and second, I wanted to showcase how to use Viewports in 3D in Godot. Viewports are something that a lot of users have trouble with, even experienced users express confusion over what Viewports should be used for. This post walks the user through the process of setting up a Viewport and using it as a render texture. At the end of the tutorial the user is able to use render a planet from a 2D texture including setting the roughness of the ocean to make it more water-like. I hope that new users will be able to use this tutorial to jumpstart making procedural solar systems of their own! #### Components The tutorial covers the following topics: * How to use a Viewport as a render texture * Mapping a texture to a sphere with equirectangular mapping * Fragment shader techniques for procedural planets * Setting a Roughness map from a Viewport Texture In a game engine, a Viewport is a surface that objects are rendered to. By default your scene contains a Viewport that is built into the scene itself. Godot also provides an interface to create your own Viewports to render to. In other engines these would be called offscreen buffers, or render targets. While using a Viewport is actually quite easy, many users express frustration over the process. This tutorial aims to make it a little easier to understand. One area that the tutorial covers that is relatively unique is how equirectangular projection works and how to set your texture up so that the equirectangular projection works out of the box in Godot. Equirectangular projection is one way of mapping a 2D texture to a sphere. It is very commonly used in computer graphics nowadays. At the end of the tutorial the reader will have created a planet that looks like the one below. http://docs.godotengine.org/en/latest/_images/planet_ocean_reflect.png #### Links http://docs.godotengine.org/en/latest/tutorials/viewports/using_viewport_as_texture.html #### GitHub Proof of Authorship - GitHub Account: https://github.com/clayjohn - Pull Request: https://github.com/godotengine/godot-docs/pull/1606
author | clayjohn |
---|---|
permlink | godot-documentation-using-a-viewport-as-a-texture |
category | utopian-io |
json_metadata | {"tags":["utopian-io","documentation","gamedev","godot"],"image":["http://docs.godotengine.org/en/latest/_images/planet_example.png","http://docs.godotengine.org/en/latest/_images/planet_ocean_reflect.png"],"links":["https://github.com/godotengine/godot-docs","https://github.com/godotengine/godot","http://docs.godotengine.org/en/latest/tutorials/viewports/using_viewport_as_texture.html","https://github.com/clayjohn","https://github.com/godotengine/godot-docs/pull/1606"],"app":"steemit/0.1","format":"markdown"} |
created | 2018-08-18 22:14:18 |
last_update | 2018-08-18 22:14:18 |
depth | 0 |
children | 4 |
last_payout | 2018-08-25 22:14:18 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 23.438 HBD |
curator_payout_value | 7.412 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 2,689 |
author_reputation | 12,492,798,894,700 |
root_title | "Godot Documentation: Using a Viewport As a Texture" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 68,640,793 |
net_rshares | 23,436,638,500,158 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
arcange | 0 | 47,938,766,615 | 5% | ||
raphaelle | 0 | 2,888,644,039 | 5% | ||
azizbd | 0 | 2,299,604,950 | 2% | ||
yuxi | 0 | 3,032,073,777 | 10% | ||
lordneroo | 0 | 13,187,904,413 | 50% | ||
miniature-tiger | 0 | 108,311,098,285 | 100% | ||
mys | 0 | 14,901,063,884 | 15% | ||
bachuslib | 0 | 19,640,535,475 | 100% | ||
pixelfan | 0 | 21,908,251,073 | 13% | ||
dreamarif | 0 | 90,474,410 | 10% | ||
renatomacedo | 0 | 161,422,487 | 30% | ||
jrawsthorne | 0 | 9,553,592,210 | 100% | ||
loshcat | 0 | 3,000,150,877 | 100% | ||
pataty69 | 0 | 9,374,468,718 | 30% | ||
utopian-io | 0 | 20,655,092,049,210 | 30% | ||
rafpokmac | 0 | 5,633,327,321 | 100% | ||
steemtaker | 0 | 2,293,311,788 | 6% | ||
jahedkhan | 0 | 277,158,988 | 9% | ||
ajayyy | 0 | 6,850,730,199 | 100% | ||
mvanyi | 0 | 1,755,506,011 | 100% | ||
amosbastian | 0 | 33,930,635,881 | 48.52% | ||
tdre | 0 | 5,412,573,392 | 100% | ||
grzesiekb | 0 | 146,625,671,768 | 100% | ||
smjn | 0 | 18,987,822,020 | 100% | ||
jjay | 0 | 854,401,658 | 100% | ||
ayay | 0 | 77,967,922 | 11% | ||
statsexpert | 0 | 3,260,849,363 | 60% | ||
dexterdoggy | 0 | 1,950,033,258 | 100% | ||
enlighted | 0 | 154,959,988 | 30% | ||
clayjohn | 0 | 14,636,047,676 | 100% | ||
enrag | 0 | 487,635,240 | 100% | ||
alina34 | 0 | 486,352,864 | 100% | ||
zaykanew | 0 | 485,327,579 | 100% | ||
davidisaevv | 0 | 486,266,838 | 100% | ||
boyarovkostya | 0 | 486,910,942 | 100% | ||
davletshi | 0 | 488,454,901 | 100% | ||
ivan.gotovin | 0 | 485,159,457 | 100% | ||
eduard999 | 0 | 485,220,967 | 100% | ||
frost013 | 0 | 497,427,136 | 100% | ||
missnadeen | 0 | 484,300,918 | 100% | ||
maruse4ka | 0 | 487,561,698 | 100% | ||
danielnewsomm | 0 | 485,187,868 | 100% | ||
oninkarapetyan | 0 | 485,562,911 | 100% | ||
meyukekogev | 0 | 486,033,511 | 100% | ||
klaraminasyan | 0 | 486,036,247 | 100% | ||
polsikio | 0 | 486,033,511 | 100% | ||
ismaelahr | 0 | 486,036,247 | 100% | ||
xlibanti | 0 | 486,033,511 | 100% | ||
levongalstyan68 | 0 | 486,036,247 | 100% | ||
armangalstyan | 0 | 486,036,247 | 100% | ||
danielaminas | 0 | 486,036,247 | 100% | ||
randolambo | 0 | 486,033,511 | 100% | ||
brutalsperm | 0 | 486,036,247 | 100% | ||
efficientseptum | 0 | 486,036,247 | 100% | ||
iridiumnonagon | 0 | 495,149,427 | 100% | ||
rhodiumyellow | 0 | 486,033,511 | 100% | ||
unarmedxyloid | 0 | 486,033,511 | 100% | ||
actmoo | 0 | 489,410,615 | 100% | ||
kendip | 0 | 486,036,247 | 100% | ||
kravecmarina | 0 | 486,036,247 | 100% | ||
katerinakarim | 0 | 489,073,974 | 100% | ||
billycrou | 0 | 486,036,247 | 100% | ||
gartiv88 | 0 | 486,036,247 | 100% | ||
rwalczak | 0 | 486,239,748 | 100% | ||
mightypanda | 0 | 19,758,168,772 | 100% | ||
gravityenteral | 0 | 486,036,247 | 100% | ||
benrest | 0 | 487,823,080 | 100% | ||
whirrhomerun | 0 | 486,033,511 | 100% | ||
remsolo | 0 | 486,033,511 | 100% | ||
pegsstadium | 0 | 486,033,511 | 100% | ||
movementfrugal | 0 | 484,424,668 | 100% | ||
bungxebec | 0 | 495,149,427 | 100% | ||
embryofemur | 0 | 486,036,247 | 100% | ||
gallopescabeche | 0 | 495,149,427 | 100% | ||
synclinereeve | 0 | 486,265,612 | 100% | ||
resultgame | 0 | 486,033,511 | 100% | ||
rattyopera | 0 | 486,033,511 | 100% | ||
pastrytorn | 0 | 486,033,511 | 100% | ||
fadedclassic | 0 | 486,036,247 | 100% | ||
celsiusdelete | 0 | 486,036,247 | 100% | ||
potatoloosen | 0 | 486,033,511 | 100% | ||
nonrespond | 0 | 486,033,511 | 100% | ||
putridbrecon | 0 | 486,033,511 | 100% | ||
kiraluchkova | 0 | 486,036,247 | 100% | ||
djane860 | 0 | 486,036,247 | 100% | ||
be1ozer | 0 | 486,036,247 | 100% | ||
lisicka | 0 | 486,036,247 | 100% | ||
makarova12 | 0 | 486,036,247 | 100% | ||
samakovgor | 0 | 486,033,511 | 100% | ||
romansilenkov | 0 | 486,033,511 | 100% | ||
kernovanatali | 0 | 486,036,247 | 100% | ||
reginasamkova | 0 | 489,071,221 | 100% | ||
nautilusx | 0 | 486,033,511 | 100% | ||
odetta199 | 0 | 486,033,511 | 100% | ||
rebrovivan | 0 | 486,033,511 | 100% | ||
cinnamonclay | 0 | 486,036,247 | 100% | ||
bibslivered | 0 | 486,036,247 | 100% | ||
enlargedremove | 0 | 495,149,427 | 100% | ||
queensstar | 0 | 486,033,511 | 100% | ||
logosuperb | 0 | 486,036,247 | 100% | ||
homesickhow | 0 | 486,036,247 | 100% | ||
liquidmeat | 0 | 486,036,247 | 100% | ||
snailrepeat | 0 | 486,033,511 | 100% | ||
desktopcarrots | 0 | 486,036,247 | 100% | ||
suburbanmammary | 0 | 486,033,511 | 100% | ||
toplice | 0 | 489,071,221 | 100% | ||
dunbirdderision | 0 | 495,149,427 | 100% | ||
weakshare | 0 | 486,033,511 | 100% | ||
strangetwelve | 0 | 489,071,221 | 100% | ||
amusingbun | 0 | 486,033,511 | 100% | ||
hastypeacock | 0 | 495,149,427 | 100% | ||
relaxrepeat | 0 | 486,033,511 | 100% | ||
holderroots | 0 | 495,149,427 | 100% | ||
riftlustful | 0 | 486,033,511 | 100% | ||
waveoutsiders | 0 | 486,033,511 | 100% | ||
shagtheorem | 0 | 486,033,511 | 100% | ||
heapimport | 0 | 486,036,247 | 100% | ||
mereflag | 0 | 486,033,511 | 100% | ||
eatercaper | 0 | 486,036,247 | 100% | ||
crystaleur | 0 | 486,036,247 | 100% | ||
spidervariety | 0 | 486,033,511 | 100% | ||
snoozesalsa | 0 | 486,033,511 | 100% | ||
bubblyhexes | 0 | 489,071,221 | 100% | ||
knifedutiful | 0 | 486,036,247 | 100% | ||
muddygrey | 0 | 486,033,511 | 100% | ||
lotgreasy | 0 | 489,073,974 | 100% | ||
cameramalt | 0 | 486,033,511 | 100% | ||
sheepishdiagram | 0 | 486,033,511 | 100% | ||
couldpinkie | 0 | 486,033,511 | 100% | ||
ocelotmultiply | 0 | 486,033,511 | 100% | ||
rydbergactinium | 0 | 486,033,511 | 100% | ||
blazarpastebin | 0 | 486,033,511 | 100% | ||
flatschowder | 0 | 486,036,247 | 100% | ||
riemannevening | 0 | 486,033,511 | 100% | ||
okapitonov88 | 0 | 485,951,255 | 100% | ||
alexkorban93 | 0 | 485,951,255 | 100% | ||
akudrin88 | 0 | 495,062,841 | 100% | ||
duarte9sousa | 0 | 16,348,416,207 | 10% | ||
iauns | 0 | 20,006,175,079 | 100% | ||
rigelnull | 0 | 485,951,255 | 100% | ||
paelladiamond | 0 | 482,914,059 | 100% | ||
englishbracket | 0 | 482,914,059 | 100% | ||
maskoil | 0 | 485,951,255 | 100% | ||
samoansomber | 0 | 485,951,255 | 100% | ||
shockingextoll | 0 | 487,398,505 | 100% | ||
wellabsorbs | 0 | 487,398,505 | 100% | ||
meaninglathered | 0 | 487,398,505 | 100% | ||
trimminiature | 0 | 487,393,564 | 100% | ||
steem-ua | 0 | 2,163,623,850,115 | 90% | ||
anna151286 | 0 | 486,521,883 | 100% | ||
sernikolaev | 0 | 495,641,463 | 100% | ||
atihonov1990 | 0 | 486,513,979 | 100% | ||
etanuelch | 0 | 486,511,303 | 100% | ||
bridzhesc | 0 | 486,511,303 | 100% | ||
rodzherg | 0 | 486,511,303 | 100% | ||
oleg.domov | 0 | 486,496,786 | 100% | ||
anmakarov19 | 0 | 486,480,999 | 100% | ||
ankolzov1982 | 0 | 486,480,999 | 100% | ||
ynaabramova | 0 | 486,480,999 | 100% | ||
ivan.krasnenko | 0 | 486,475,684 | 100% | ||
zelc | 0 | 486,470,712 | 100% | ||
freef | 0 | 486,475,684 | 100% | ||
potex | 0 | 486,470,712 | 100% |
Thats a really great contribution. As I pointed out before that you are doing really great work for this project. I really appreciate your efforts I can honestly say this is one of the gem contributions of my category and I am staff picking it. Keep up the great work. I am really looking forward to more contributions from you. Keep Contributing Your contribution has been evaluated according to [Utopian policies and guidelines](https://join.utopian.io/guidelines), as well as a predefined set of questions pertaining to the category. To view those questions and the relevant answers related to your post, [click here](https://review.utopian.io/result/4/1211122). ---- Need help? Write a ticket on https://support.utopian.io/. Chat with us on [Discord](https://discord.gg/uTyJkNm). [[utopian-moderator]](https://join.utopian.io/)
author | ms10398 |
---|---|
permlink | re-clayjohn-godot-documentation-using-a-viewport-as-a-texture-20180820t070952803z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"links":["https://join.utopian.io/guidelines","https://review.utopian.io/result/4/1211122","https://support.utopian.io/","https://discord.gg/uTyJkNm","https://join.utopian.io/"],"app":"steemit/0.1"} |
created | 2018-08-20 07:09:54 |
last_update | 2018-08-20 07:09:54 |
depth | 1 |
children | 1 |
last_payout | 2018-08-27 07:09:54 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 3.901 HBD |
curator_payout_value | 1.266 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 843 |
author_reputation | 27,572,487,973,390 |
root_title | "Godot Documentation: Using a Viewport As a Texture" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 68,775,856 |
net_rshares | 3,844,269,842,003 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
mys | 0 | 10,132,723,441 | 10.17% | ||
pixelfan | 0 | 14,989,767,992 | 9% | ||
espoem | 0 | 17,238,903,438 | 15% | ||
utopian-io | 0 | 3,784,260,109,071 | 5.38% | ||
amosbastian | 0 | 3,116,078,805 | 4.29% | ||
clayjohn | 0 | 14,192,531,080 | 100% | ||
mops2e | 0 | 339,728,176 | 10% |
Thank you for your review, @ms10398! So far this week you've reviewed 3 contributions. Keep up the good work!
author | utopian-io |
---|---|
permlink | re-re-clayjohn-godot-documentation-using-a-viewport-as-a-texture-20180820t070952803z-20180822t072009z |
category | utopian-io |
json_metadata | "{"app": "beem/0.19.42"}" |
created | 2018-08-22 07:20:09 |
last_update | 2018-08-22 07:20:09 |
depth | 2 |
children | 0 |
last_payout | 2018-08-29 07:20:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.017 HBD |
curator_payout_value | 0.003 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 110 |
author_reputation | 152,955,367,999,756 |
root_title | "Godot Documentation: Using a Viewport As a Texture" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 68,992,457 |
net_rshares | 15,194,823,646 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
espoem | 0 | 14,889,068,288 | 15% | ||
mops2e | 0 | 305,755,358 | 10% |
Hi @clayjohn! We are @steem-ua, a new Steem dApp, computing UserAuthority for all accounts on Steem. We are currently in test modus upvoting quality Utopian-io contributions! Nice work!
author | steem-ua |
---|---|
permlink | re-godot-documentation-using-a-viewport-as-a-texture-20180820t071754z |
category | utopian-io |
json_metadata | "{"app": "beem/0.19.54"}" |
created | 2018-08-20 07:17:54 |
last_update | 2018-08-20 07:17:54 |
depth | 1 |
children | 0 |
last_payout | 2018-08-27 07:17:54 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 185 |
author_reputation | 23,214,230,978,060 |
root_title | "Godot Documentation: Using a Viewport As a Texture" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 68,776,465 |
net_rshares | 13,896,853,349 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
clayjohn | 0 | 13,896,853,349 | 100% |
Hey @clayjohn **Thanks for contributing on Utopian**. Congratulations! Your contribution was Staff Picked to receive a maximum vote for the documentation category on Utopian for being of significant value to the project and the open source community. Weβre already looking forward to your next contribution! **Want to chat? Join us on Discord https://discord.gg/h52nFrV.** <a href='https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1'>Vote for Utopian Witness!</a>
author | utopian-io |
---|---|
permlink | re-godot-documentation-using-a-viewport-as-a-texture-20180821t051509z |
category | utopian-io |
json_metadata | "{"app": "beem/0.19.42"}" |
created | 2018-08-21 05:15:09 |
last_update | 2018-08-21 05:15:09 |
depth | 1 |
children | 0 |
last_payout | 2018-08-28 05:15:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.017 HBD |
curator_payout_value | 0.003 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 499 |
author_reputation | 152,955,367,999,756 |
root_title | "Godot Documentation: Using a Viewport As a Texture" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 68,876,721 |
net_rshares | 15,824,359,195 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
espoem | 0 | 15,484,631,019 | 15% | ||
mops2e | 0 | 339,728,176 | 10% |