Difference between revisions of "Eyeball"

From Valve Developer Community
Jump to: navigation, search
(Parameters)
(Removed information only true for the Eyes shader, added disambiguation template)
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Image:Eye demoman.jpg|thumb|The Demoman's eyeball.]]
+
[[Image:Eye demoman.jpg|thumb|The Demoman's eyeball, using the [[EyeRefract]] shader.]]
[[Image:Eye alyxep2.jpg|thumb|Alyx's eyeball in Ep2.]]
+
[[Image:Eye alyxep2.jpg|thumb|Alyx's eyeball in [[Episode Two]], using the obsolete [[Eyes]] shader.]]
 
[[Image:Eye vortep2.jpg|thumb|A vortigaunt's largest eye. The iris covers its entire surface.]]
 
[[Image:Eye vortep2.jpg|thumb|A vortigaunt's largest eye. The iris covers its entire surface.]]
 
+
{{For|about=the [[QC]] property of [[$model]]|the shaders used to render the eyes|{{ent|EyeRefract}} and {{ent|Eyes}}|the tool|[[qc_eyes]]}}
'''<code>Eyeball</code>''' is a property of [[$model (QC)|$model]]. It consists of two components:
+
'''<code>Eyeball</code>''' is a property of [[$model (QC)|$model]]. It defines the data needed to properly render a character's eyes, defining the name, positioning, size and material of the eyeball.
 
 
# An 'eye white' surface on the model, with a unique material.
 
# A dynamic [[Wikipedia:Iris (anatomy)|iris]] decal that travels over the eye white material to simulate the eye looking in different directions.
 
 
 
{{tip|An iris material can cover the entire surface of the eye if need be.}}
 
  
 
== Parameters ==
 
== Parameters ==
Line 18: Line 13:
 
;<code><bone_name></code>
 
;<code><bone_name></code>
 
: The bone which the eye is parented to, typically the head.
 
: The bone which the eye is parented to, typically the head.
;<code><X> <Y> <Z></code>
+
;<code><[[X]]> <[[Y]]> <[[Z]]></code>
: World location of the center of the ball of the eye.
+
: World location of the center of the ball of the eye. While your eye doesn't need to be a sphere in the model, Source will always map the material according to an invisible ball.
 
;<code><material_name></code>
 
;<code><material_name></code>
: Material above which the iris material will be drawn. Make sure every eye has a unique one!
+
: Material of the eye. Make sure each or every eye has a unique one. It is recommended to use a material using the <code>EyeRefract</code> shader.
 
;<code><diameter></code>
 
;<code><diameter></code>
: Width of the eyeball when viewed from the front. Used to prevent the iris from rolling inside the head. {{note|The iris will travel in a circle even if the eyeball is oval. Your model's [[flex]] should accommodate for this.}}
+
: Width of the eyeball when viewed from the front. Used to prevent the iris from rolling inside the head. {{note|The iris will travel in a circle even if the eyeball is oval. Your model's [[flex]] should accommodate for this. {{todo|How?}} }}
 
;<code><angle></code>
 
;<code><angle></code>
: Default yaw offset (from directly forward) for iris. Humans are typically 2-4 degrees [[Wikipedia:Strabismus|wall-eyed]]. Not setting this correctly will result in either your characters appearing cross-eyed, or if you've compensated by misplacing the ball of the eye, them not tracking side to side.
+
: Default yaw offset (from directly forward) for the iris. Humans are typically 2-4 degrees [[Wikipedia:Strabismus|wall-eyed]]. Not setting this correctly will result in either your characters appearing cross-eyed, or if you've compensated by misplacing the ball of the eye, them not tracking side to side. Should be a negative value for the left eye, and a positive value for the right eye.
 
;<code><iris_material></code>
 
;<code><iris_material></code>
: Material used as the iris texture. This is is used by the compiler to identify what part of the mesh matches which eyeball, and must be the same material name in the QC as it appears assigned to the mesh.
+
: Material used as the iris texture. (This property is deprecated)
 
;<code><iris_scale></code>
 
;<code><iris_scale></code>
: Scale of the iris texture.
+
: Scale of the iris texture. The model's UV map does not influence the eye material in any way. {{todo|While this is true for <code>EyeRefract</code>, is this also true for the <code>Eyes</code> shader?}}
  
 
=== Example ===
 
=== Example ===
Line 35: Line 30:
 
Hover your mouse over each value for its description.
 
Hover your mouse over each value for its description.
  
  [[$model (QC)|$model]] "female_01" "female_01_reference_RE.smd" {
+
  [[$model (QC)|$model]] "female_01" "female_01_reference_RE.smd"
    '''eyeball''' <span title="Eye name" style="background:#DFDFDF;">righteye</span> <span title="Parent bone" style="background:#DFDFDF;">ValveBiped.Bip01_Head1</span> <span title="Center co-ords" style="background:#DFDFDF;">-1.261 -3.702 64.974</span> <span title="Eye white material" style="background:#DFDFDF;">eyeball_r</span> <span title="Diameter" style="background:#DFDFDF;">1</span> <span title="Angle" style="background:#DFDFDF;">4</span> <span title="Iris material" style="background:#DFDFDF;">pupil_r</span> <span title="Iris scale" style="background:#DFDFDF;">0.66</span>
+
{
 +
'''eyeball''' <span title="Eye name" style="background:#DFDFDF;">righteye</span> <span title="Parent bone" style="background:#DFDFDF;">ValveBiped.Bip01_Head1</span> <span title="Center co-ords" style="background:#DFDFDF;">-1.261 -3.702 64.974</span> <span title="Eye white material" style="background:#DFDFDF;">eyeball_r</span> <span title="Diameter" style="background:#DFDFDF;">1</span> <span title="Angle" style="background:#DFDFDF;">4</span> <span title="Iris material" style="background:#DFDFDF;">pupil_r</span> <span title="Iris scale" style="background:#DFDFDF;">0.66</span>
 
  }
 
  }
  
 
== See also ==
 
== See also ==
  
* The <code>[[EyeRefract]]</code> and <code>[[Eyes]]</code> shaders
 
 
* [[Eye Position Setup]], for a guide to calculating the various numbers required
 
* [[Eye Position Setup]], for a guide to calculating the various numbers required
* <code>[[qc_eyes]]</code>, a tool to aid your calculations
 
  
 
[[Category:Modeling]]
 
[[Category:Modeling]]

Latest revision as of 23:16, 18 February 2020

The Demoman's eyeball, using the EyeRefract shader.
Alyx's eyeball in Episode Two, using the obsolete Eyes shader.
A vortigaunt's largest eye. The iris covers its entire surface.
This article is about the QC property of $model. For the shaders used to render the eyes, see EyeRefract and Eyes. For the tool, see qc_eyes.

Eyeball is a property of $model. It defines the data needed to properly render a character's eyes, defining the name, positioning, size and material of the eyeball.

Parameters

Tip:The qc_eyes tool can help you manage the potentially confusing string of numbers needed for this command.
<name>
Name of eyeball, used to match eyelid rules. For humans, use righteye and lefteye.
<bone_name>
The bone which the eye is parented to, typically the head.
<X> <Y> <Z>
World location of the center of the ball of the eye. While your eye doesn't need to be a sphere in the model, Source will always map the material according to an invisible ball.
<material_name>
Material of the eye. Make sure each or every eye has a unique one. It is recommended to use a material using the EyeRefract shader.
<diameter>
Width of the eyeball when viewed from the front. Used to prevent the iris from rolling inside the head.
Note:The iris will travel in a circle even if the eyeball is oval. Your model's flex should accommodate for this. To do: How?
<angle>
Default yaw offset (from directly forward) for the iris. Humans are typically 2-4 degrees wall-eyed. Not setting this correctly will result in either your characters appearing cross-eyed, or if you've compensated by misplacing the ball of the eye, them not tracking side to side. Should be a negative value for the left eye, and a positive value for the right eye.
<iris_material>
Material used as the iris texture. (This property is deprecated)
<iris_scale>
Scale of the iris texture. The model's UV map does not influence the eye material in any way. To do: While this is true for EyeRefract, is this also true for the Eyes shader?

Example

Hover your mouse over each value for its description.

$model "female_01" "female_01_reference_RE.smd"
{
	eyeball righteye ValveBiped.Bip01_Head1 -1.261 -3.702 64.974 eyeball_r 1 4 pupil_r 0.66
}

See also