-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathPhongLightSource.cs
More file actions
50 lines (44 loc) · 1.38 KB
/
PhongLightSource.cs
File metadata and controls
50 lines (44 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System;
using System.Numerics;
namespace Waher.Script.Graphs3D
{
/// <summary>
/// Contains information about a light source, as used in the Phong reflection model.
/// https://en.wikipedia.org/wiki/Phong_reflection_model
/// </summary>
public class PhongLightSource
{
private readonly PhongIntensity diffuse;
private readonly PhongIntensity specular;
private Vector3 position;
/// <summary>
/// Contains information about a light source, as used in the Phong reflection model.
/// https://en.wikipedia.org/wiki/Phong_reflection_model
/// </summary>
/// <param name="Diffuse">Diffuse intensity.</param>
/// <param name="Specular">Specular intensity.</param>
/// <param name="Position">Position of light source.</param>
public PhongLightSource(PhongIntensity Diffuse, PhongIntensity Specular, Vector3 Position)
{
this.diffuse = Diffuse;
this.specular = Specular;
this.position = Position;
}
/// <summary>
/// Diffuse intensity.
/// </summary>
public PhongIntensity Diffuse => this.diffuse;
/// <summary>
/// Specular intensity.
/// </summary>
public PhongIntensity Specular => this.specular;
/// <summary>
/// Position of light source..
/// </summary>
public Vector3 Position => this.position;
/// <summary>
/// If shader is 100% opaque.
/// </summary>
public bool Opaque => this.diffuse.Opaque && this.specular.Opaque;
}
}