Breakable Glass: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (fixedup note for simplicity)
m (Nesciuse moved page Breakable Glass/en to Breakable Glass without leaving a redirect: Move en subpage to basepage)
 
(29 intermediate revisions by 18 users not shown)
Line 1: Line 1:
# Create a [[brush]] where you want the glass to be, using the [[tool textures#nodraw|nodraw]] [[texture]]. Like real glass, it should be very thin (1 inch thick).
{{LanguageBar}}
# Apply a nice-looking glass texture to one face (not on both sides). Make sure you use <code>glass/glasswindowbreak070a</code>. Don’t use <code>glass/glasswindowbreak070b</code>. All other faces should be textured with <code>tools/toolsnodraw</code>.
# Select the brush and click the "to[[Entity]]" button in the object toolbar. Choose [[func_breakable_surf]] in the drop-down list. (If you want the glass to completely shatter all at once, choose [[func_breakable]] instead.)
# Go to the [[Material]] Type [[keyvalue]] and select Glass.
# Add an [[env_cubemap]] to the surface of the glass texture (put it right on there).


{{note|You can apply your texture to just one side of the brush entity by opening the [[Hammer Face Edit Dialog]] and clicking once in the 3D view on the face you want to apply the texture to.  Then, select a material with either the drop down box or the browse button, and click apply.}}


==See Also==
 
[[File:Breakable_glass_hammer.jpg|thumb|right|300px|breakable glass samples in the hammer]]
# Create a [[brush]] where you want the glass to be, using the [[tool textures#nodraw|nodraw]] [[texture]]. Like real glass, it should be very thin (No more than 3 units thick under normal circumstances).
# Apply a nice-looking glass texture to one face (not on both sides). Make sure you use <code>glass/glasswindowbreak070a</code>. Don’t use <code>glass/glasswindowbreak070b</code>. ALL OTHER FACES MUST BE <code>tools/toolsnodraw</code>! IF NOT, IT WILL NOT BE SPAWNED IN-GAME!
# Select the brush and click the "Tie to [[Entity]]" button in the object toolbar. Choose [[func_breakable_surf]] in the drop-down list. (If you want the glass to completely shatter all at once, choose [[func_breakable]] instead.)
# Go to the '''[[Material]] Type''' [[keyvalue]] and select ''Glass''.
# Optional:  Add an [[env_cubemap]] to the surface of the glass texture.
{{note|You can apply your texture to just one side of the brush entity by opening the [[Hammer Face Edit Dialog]], ensuring the '''Mode''' is set to ''Select'' or ''Lift + Select'', and clicking once in the 3D view on the face you want to apply the texture to.  Then, select a material with either the drop down box or the browse button, and click apply.}}
 
[[func_breakable]]
Has the effect of breaking all the glass (see picture)
 
[[func_breakable_surf]]
Has the effect of partially breaking the glass (see picture)
<gallery>
Image:Func_breakable.jpg|Func_breakable effect
Image:Func_breakable_surf.jpg|Func_breakable_surf effect
</gallery>
 
==See also==
*[[Glass that starts out broken]]
*[[Hammer Face Edit Dialog]]
*[[Hammer Face Edit Dialog]]
*[[Cubemaps]]
[[Category:Level Design]]
[[Category:Level Design]]
 
[[Category:Tutorials]]
{{otherlang:en}}
{{otherlang:en:jp|Breakable Glass:jp}}

Latest revision as of 05:17, 12 July 2024

English (en)日本語 (ja)Polski (pl)Português do Brasil (pt-br)Русский (ru)中文 (zh)Translate (Translate)


breakable glass samples in the hammer
  1. Create a brush where you want the glass to be, using the nodraw texture. Like real glass, it should be very thin (No more than 3 units thick under normal circumstances).
  2. Apply a nice-looking glass texture to one face (not on both sides). Make sure you use glass/glasswindowbreak070a. Don’t use glass/glasswindowbreak070b. ALL OTHER FACES MUST BE tools/toolsnodraw! IF NOT, IT WILL NOT BE SPAWNED IN-GAME!
  3. Select the brush and click the "Tie to Entity" button in the object toolbar. Choose func_breakable_surf in the drop-down list. (If you want the glass to completely shatter all at once, choose func_breakable instead.)
  4. Go to the Material Type keyvalue and select Glass.
  5. Optional: Add an env_cubemap to the surface of the glass texture.
Note.pngNote:You can apply your texture to just one side of the brush entity by opening the Hammer Face Edit Dialog, ensuring the Mode is set to Select or Lift + Select, and clicking once in the 3D view on the face you want to apply the texture to. Then, select a material with either the drop down box or the browse button, and click apply.

func_breakable Has the effect of breaking all the glass (see picture)

func_breakable_surf Has the effect of partially breaking the glass (see picture)

See also