This article's documentation is for anything that uses the Source engine. Click here for more information.

Env cubemap: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Finished Keyvalues, Higher Resolution Cubemaps, Placement and Building Cubemaps sections)
mNo edit summary
Line 1: Line 1:
<!-- When this page is updated to {{langsp}} or {{langsp}} instead of {{lang}}, please move {{this is a}} to the base page, as it is automatically translated. -->{{lang}}{{tabs|source=1|source2=1|main=source|Env cubemap}}
<!-- When this page is updated to {{langsp}} or {{langsp}} instead of {{lang}}, please move {{this is a}} to the base page, as it is automatically translated. -->{{lang}}{{tabs|source=1|source2=1|main=source|Env cubemap}}
[[File:Cubemap_build_result.jpeg|thumb|right|Um exemplo de cubemap contendo o carro branco como um {{L|prop_static}}, um {{L|env_sprite}} e decals. Observe que o carro azul como {{L|prop_physics}} não e visível no cubemap porque não e estático.]]
[[File:Cubemap_build_result.jpeg|thumb|right|A cubemap example containing the white static prop car, a sprite and decals. Note that the blue physics prop car is not visible in the cubemap because it is not static.]]
{{this is a|point entity|internal=1|name=env_cubemap|sprite=1}} Ela especifica a localização para o qual um {{L|cubemap}} será gerado quando o comando {{L|buildcubemaps}} for executado no console. [[Material]]s com {{L|$envmap}} usarão o cubemap mais próximo como seu reflexo.
{{this is a|point entity|internal=1|name=env_cubemap|sprite=1}} It specifies a location for which a [[cubemap]] will be generated when the {{Ent|buildcubemaps}} console command is executed. [[Material]]s with {{Ent|$envmap}} will use the nearest cubemap as their reflection.
{{intent}}
{{intent}}
{{note|Cubemaps conterão static props, sprites, decals, (como sangue inimigo e sprays de jogadores) e de alguma forma a textura da lanterna em primeira pessoa<br> Então desligue a sua lanterna se estiver em um mapa escuro, caso contrário, tudo o que você estiver olhando ficará claro no cubemap.}}
{{note|Cubemaps will contain static props, sprites, decals, (such as enemy blood and user sprays) and somehow also the flashlight texture you have in first person mode<br> So turn your flashlight off if you're on a dark map, else whatever you're looking at will be bright in the cubemap.}}




Line 9: Line 9:


== Keyvalues ==
== Keyvalues ==
{{KV|Cubemap Size|intn=cubemapsize|choices|A resolição de cada face do cubemap. Lembre-se de que o número real de pixels armazenados será sua seleção vezes seis (ou sete, dependendo da branch da engine), portanto, números altos resultarão em tamanhos de arquivos muito grandes!}}
{{KV|cubemapsize|choices|The resolution of each face of the cubemap. Remember that the actual number of pixels stored will be your selection times six (or seven, depending upon engine branch), so higher numbers will make for very large file sizes!}}
[[File:Cubemaps_comparison_new.jpg|thumb|Comparação da qualidade da reflexão.]]
[[File:Cubemaps_comparison_new.jpg|thumb|Comparison of reflection quality.]]


:*0: Default (geralmente 32x32, dependendo do jogo)
:*0: Default (usually 32x32, depending on the game)
:*1: 1x1
:*1: 1x1
:*2: 2x2
:*2: 2x2
Line 25: Line 25:
:*11: 1024x1024 ¹ {{Not in FGD}}
:*11: 1024x1024 ¹ {{Not in FGD}}
:*12: 2048x2048 ¹ {{Not in FGD}}
:*12: 2048x2048 ¹ {{Not in FGD}}
¹ - Para renderizar cubemaps de resolução superior a 256x256, veja [[Env_cubemap#Higher Resolution Cubemaps|abaixo]].
¹ - To render higher resolution cubemaps than 256x256, see [[Env_cubemap#Higher Resolution Cubemaps|below]].


{{KV|Brush faces|intn=sides|sidelist|Uma substituição opcional para faces individuais de um brush, forçando-as usar este cubemap em vez de um mais próximo a elas. Para selecionar faces, pressione o botão '''Pick''' e clique nelas na visualização 3D. Segure {{key|Ctrl}} para ativar ou desativar uma face.}}
{{KV|sides|sidelist|An optional override for individual brush faces, forcing them to use this cubemap instead of one closest to them. To select faces, press the '''Pick''' button then click on them in the 3D view. Hold {{key|Ctrl}} to toggle a face on or off.}}
{{KV|Cubemap Bounds|intn=parallaxobb|targetname|apenas em jogos com={{strata|4}} e {{mapbase|4}} |Opcionalmente, atribui a este cubemap uma bounding box para correção parallax (a entidade brush vinculada a {{L|parallax_obb}}). Isso significa que o reflexo do cubemap se moverá conforme a câmera se move, semelhante a func_reflective_glass.}}
{{KV|Cubemap Bounds|intn=parallaxobb|targetname|only={{strata|4}} and {{mapbase|4}} games|Optionally assigns this cubemap a bounding box for parallax correction (brush entity tied to {{ent|parallax_obb}}). This means the cubemap reflection will move as the camera moves, similar to func_reflective_glass.}}


== Cubemaps de Alta Resolução ==
== Higher Resolution Cubemaps ==
[[File:4k.jpg|thumb|423px|right|]]
[[File:4k.jpg|thumb|423px|right|]]
Desative o Smart Edit e dgite um valor de 10 ou mais. Isso dará a resolução correspondente aos powers de 2 (512x512, 1024x1024 etc).
Turn off Smart Edit and type in a value 10 or more. That will give the resolution corresponding to the next powers of 2 (512x512, 1024x1024 etc).
{{warning|Em {{csgo}} tentar construir uma cubemap 1024x1024 resultarar em Erro na Engine.}}
{{warning|In {{csgo}} trying to build a 1024x1024 cubemap will result in Engine Error.}}
{{note|Contruir cubemaps requer que sua tela seja pelo menos 4 vezes maior em dimensão doque a resolução do cubemap. Se sua tela for menor que isso, use Dynamic Super Resolution (DSR) para construí-las. }}
{{note|Building cubemaps requires your screen to be at least 4 times in each dimension as big as the cubemap's resolution. If your screen is smaller than that, use Dynamic Super Resolution (DSR) to build them. }}
{{note|Ter cubemaps de alta resolução pode aumentar significativamente o tamanho do arquivo do mapa. Portanto, use com moderação para coisas como espelhos e superfícies de mármore, se você estiver preocupado com o tamanho do arquivo / tempo de download do client para mapas multijogador, pelo menos.}}
{{note|Having high resolution cubemaps can significantly increase the map file size. So use sparingly for things like mirrors and marble surfaces, if you're concerned about file size / client download time for multiplayer maps at least.}}


== Colocação ==
== Placement ==
Declarar áreas a serem cobertas pelo cubemaps é simples, basta colocar a entidade de origem do <code>env_cubemap</code> dentro de uma área de um mapa. Quando o mapa é compilado com o {{L|vbsp|VBSP}}, as superfícies geométricas mundiais associam-se automaticamente ao <code>env_cubemap</code> mais próximo e usarão o cubemap gerado a partir dele. As entidades se associam ao <code>env_cubemap</code> mais próximo de sua origem (alternativamente, um cubemap pode ser aplicado a faces específicas de um brush nas propriedades do cubemap); entidades que se movem mudarão dinamicamente qual cubemap elas usam. É importante escolher as posições do <code>env_cubemap</code> adequadamente tanto para questões estéticas quanto de desempenho.
Declaring areas for cubemaps to cover is simple, just place an <code>env_cubemap</code> point entity inside the space of a map. When the map is compiled with [[vbsp|VBSP]], world geometry surfaces automatically associate themselves with the nearest <code>env_cubemap</code> and will use the cubemap generated from it. Entities associate themselves with the <code>env_cubemap</code> closest to their origin (alternatively, a cubemap can be applied to specific brush faces in the cubemap's properties); moving entities will dynamically change which cubemap they use. It is important to choose <code>env_cubemap</code> positions properly for both aesthetic and performance issues.


Cubemaps são usados de algumas formas e maneiras específicas, e deve ser colocado de acordo. Alguns cubemaps são usados para reflexões sobre a geometria estática do mundo. Outros são usados com entidades de jogadores, incluindo {{L|NPC|NPCs}}. A colocação de entidades <code>env_cubemap</code> corresponde a cada um desses usos, para garantir o máximo benefício de seu uso, ''visualmente e no desempenho'' Aqui estão algumas heurísticas simples a serem seguidas:
Cubemaps are used in a few specific ways, and should be placed accordingly. Some cubemaps are used for reflections on static world geometry. Others are used with player entities, including [[NPC|NPCs]]. And the rest are used for any non-player reflective entities. The optimal placement of <code>env_cubemap</code> entities corresponds with each of these uses, to ensure the maximal benefit, ''visually and in performance.'' Here are a few simple heuristics to follow:


* Se uma cubemap for destinada a NPCs ou ao jogador, o <code>env_cubemap</code> deve ser colada ao nível dos olhos (geralmente a 64 unidades hammer) sobre o chão. Dessa forma, o cubempa representará com mais precisão o mundo da perspectiva do jogador.  
* If a cubemap is intended for NPCs or the player, the <code>env_cubemap</code> should be placed at eye-level (usually 64 hammer units) above the ground. This way, the cubemap will most accurately represent the world from the perspective of the player.  
{{tip|Você pode fazer isso copiando e colando as entidades <code>env_cubemap</code> ao redor do mapa e então usar a função '''Entity Report''' do Hammer para selecionar todas as entidades <code>env_cubemap</code> e então movendo-as 64 unidades para cima usando a ferramenta '''Transform''' com {{key|Ctrl+M}}. }}
{{tip|You can achieve this by copy-pasting <code>env_cubemap</code> entities around the map floor and then use Hammer's '''Entity Report''' function to select all <code>env_cubemap</code> entities and then moving them 64 units upward by using the '''Transform''' tool {{key|Ctrl+M}}. }}
* Se um cubemap for desitnado à geometria estática do mundo, o <code>env_cubemap</code> deve estar a uma distância razoável (como um princípio básico, 16 unidades Hammer) de todas as superfícies brush.
* If a cubemap is intended for static world geometry, the <code>env_cubemap</code> should be a fair distance (as a rule of thumb, 16 Hammer units) away from all brush surfaces.
* Um cubemap diferente deve ser obtido em cada área de contraste visual disinto. Um corredor com luz amarela brilhante precisará de sua própria <code>env_cubemap</code>, especialmente se estiver próximo a uma sala com pouco luz azul. Sem dois entidades <code>env_cubemap</code>, reflexões e realces especulares pareceraão incorretos em entidades e geometria do mundo em uma das áreas.
*A different cubemap should be taken in each area of distinct visual contrast. A hallway with bright yellow light will need its own <code>env_cubemap</code>, especially if it is next to a room with low blue light. Without two <code>env_cubemap</code> entities, reflections and specular highlights will seem incorrect on entities and world geometry in one of the areas.
* Mudanças de localização, como de cômodo em cômodo, cômodo para exterior e de localização geral com grandes ncessidades de mundaças visuais necessitam de uma entidade <code>env_cubemap</code> com distância igual ambos os locais até o ponto de transição. Por exemplo, 16 unidades de distância da porta de cada cômodo. Dessa forma, a transição do cubemap entre os locais é suave. Isto impedirá que o cubemap de mostrar a localização externa dentro de um cômodo e vice-versa.
* Location changes, such as one room-to-room, room-to-outside and general location changes with great visual changes need <code>env_cubemap</code> entities with equal distance in both locations to the transition point. For example 16 units away from the doorway into each rooms. That way the cubemap transition between locations is smooth. This will prevent the cubemap from showing the outside location inside the room and vice versa.
* Cubemaps colocados em uma áreas muito escuras, assim como cubemaps colocados fora da área de jogo podem usar resolução menores. Para começar, os cubemaps escuros mal refletem nada além dos poucos pontos brilhantes. Usar resoluções menores quase não irá fazer qualquer diferença visual.
* Cubemaps set in a very dark area, as well as cubemaps outside of the playable area can use very small resolutions. Dark cubemaps barely reflect anything but the few bright spots to begin with, Using smaller ones barely makes any visual difference.


{{clr}}
{{clr}}
[[File:Env cubemap equidistant example.png|300px|thumb|left|Exemplo de um env_cubemap que é equidistante de duas molduras de porta ao mesmo tempo, com um env_cubemap adequadamente colocado no outro lado de cada moldura de porta.]]
[[File:Env cubemap equidistant example.png|300px|thumb|left|Example of an env_cubemap that is equidistant to two door frames at once, with a fitting env_cubemap on the other side of each doorframe.]]
[[File:Cubemap misplacement symptom.jpg|300px|thumb|none|Exemplo do que cubemaps mal colocados fazem.<br> O trailer e a mira do rifle refletem um cubemap de dentro da casa. O que faz com que as superfícies reflexivas pareçam brilhar à noite.]]
[[File:Cubemap misplacement symptom.jpg|300px|thumb|none|Example of what misplaced cubemaps do.<br> The trailer and rifle scope reflect a cubemap from inside the building. Which makes reflective surfaces appear to glow in the night.]]
{{clr}}
{{clr}}


== Construindo Cubemaps ==
== Building Cubemaps ==
Para obter informações gerais específicas do sobre a construção de cubemaps, visite a página {{L|Cubemaps#Building cubemaps|Cubemaps}}.
For general and game specific information about building cubemaps, visit the [[Cubemaps#Building cubemaps|Cubemaps]] page.


== Veja também ==
== See also ==
*{{Ent|weapon_cubemap}}
*{{Ent|weapon_cubemap}}
*{{Ent|parallax_obb}}
*{{Ent|parallax_obb}}

Revision as of 15:23, 22 July 2024

English (en)Deutsch (de)Français (fr)한국어 (ko)Português do Brasil (pt-br)Русский (ru)中文 (zh)中文(臺灣) (zh-tw)Translate (Translate)
A cubemap example containing the white static prop car, a sprite and decals. Note that the blue physics prop car is not visible in the cubemap because it is not static.
Env cubemap.png

env_cubemap is an internal point entity available in all Source Source games. It specifies a location for which a cubemap will be generated when the buildcubemaps console command is executed. Materials with $envmap will use the nearest cubemap as their reflection.

Template:Intent

Note.pngNote:Cubemaps will contain static props, sprites, decals, (such as enemy blood and user sprays) and somehow also the flashlight texture you have in first person mode
So turn your flashlight off if you're on a dark map, else whatever you're looking at will be bright in the cubemap.


Keyvalues

cubemapsize ([todo internal name (i)]) <choices>
The resolution of each face of the cubemap. Remember that the actual number of pixels stored will be your selection times six (or seven, depending upon engine branch), so higher numbers will make for very large file sizes!
Comparison of reflection quality.
  • 0: Default (usually 32x32, depending on the game)
  • 1: 1x1
  • 2: 2x2
  • 3: 4x4
  • 4: 8x8
  • 5: 16x16
  • 6: 32x32
  • 7: 64x64
  • 8: 128x128
  • 9: 256x256
  • 10: 512x512 ¹ !FGD
  • 11: 1024x1024 ¹ !FGD
  • 12: 2048x2048 ¹ !FGD

¹ - To render higher resolution cubemaps than 256x256, see below.


sides ([todo internal name (i)]) <sidelist>
An optional override for individual brush faces, forcing them to use this cubemap instead of one closest to them. To select faces, press the Pick button then click on them in the 3D view. Hold Ctrl to toggle a face on or off.
Cubemap Bounds (parallaxobb) <targetname> (only in Strata Source Strata Source and Mapbase Mapbase games)
Optionally assigns this cubemap a bounding box for parallax correction (brush entity tied to parallax_obb). This means the cubemap reflection will move as the camera moves, similar to func_reflective_glass.

Higher Resolution Cubemaps

4k.jpg

Turn off Smart Edit and type in a value 10 or more. That will give the resolution corresponding to the next powers of 2 (512x512, 1024x1024 etc).

Warning.pngWarning:In Counter-Strike: Global Offensive trying to build a 1024x1024 cubemap will result in Engine Error.
Note.pngNote:Building cubemaps requires your screen to be at least 4 times in each dimension as big as the cubemap's resolution. If your screen is smaller than that, use Dynamic Super Resolution (DSR) to build them.
Note.pngNote:Having high resolution cubemaps can significantly increase the map file size. So use sparingly for things like mirrors and marble surfaces, if you're concerned about file size / client download time for multiplayer maps at least.

Placement

Declaring areas for cubemaps to cover is simple, just place an env_cubemap point entity inside the space of a map. When the map is compiled with VBSP, world geometry surfaces automatically associate themselves with the nearest env_cubemap and will use the cubemap generated from it. Entities associate themselves with the env_cubemap closest to their origin (alternatively, a cubemap can be applied to specific brush faces in the cubemap's properties); moving entities will dynamically change which cubemap they use. It is important to choose env_cubemap positions properly for both aesthetic and performance issues.

Cubemaps are used in a few specific ways, and should be placed accordingly. Some cubemaps are used for reflections on static world geometry. Others are used with player entities, including NPCs. And the rest are used for any non-player reflective entities. The optimal placement of env_cubemap entities corresponds with each of these uses, to ensure the maximal benefit, visually and in performance. Here are a few simple heuristics to follow:

  • If a cubemap is intended for NPCs or the player, the env_cubemap should be placed at eye-level (usually 64 hammer units) above the ground. This way, the cubemap will most accurately represent the world from the perspective of the player.
Tip.pngTip:You can achieve this by copy-pasting env_cubemap entities around the map floor and then use Hammer's Entity Report function to select all env_cubemap entities and then moving them 64 units upward by using the Transform tool Ctrl+M.
  • If a cubemap is intended for static world geometry, the env_cubemap should be a fair distance (as a rule of thumb, 16 Hammer units) away from all brush surfaces.
  • A different cubemap should be taken in each area of distinct visual contrast. A hallway with bright yellow light will need its own env_cubemap, especially if it is next to a room with low blue light. Without two env_cubemap entities, reflections and specular highlights will seem incorrect on entities and world geometry in one of the areas.
  • Location changes, such as one room-to-room, room-to-outside and general location changes with great visual changes need env_cubemap entities with equal distance in both locations to the transition point. For example 16 units away from the doorway into each rooms. That way the cubemap transition between locations is smooth. This will prevent the cubemap from showing the outside location inside the room and vice versa.
  • Cubemaps set in a very dark area, as well as cubemaps outside of the playable area can use very small resolutions. Dark cubemaps barely reflect anything but the few bright spots to begin with, Using smaller ones barely makes any visual difference.
Example of an env_cubemap that is equidistant to two door frames at once, with a fitting env_cubemap on the other side of each doorframe.
Example of what misplaced cubemaps do.
The trailer and rifle scope reflect a cubemap from inside the building. Which makes reflective surfaces appear to glow in the night.

Building Cubemaps

For general and game specific information about building cubemaps, visit the Cubemaps page.

See also