Skip to content

Commit

Permalink
Register if texture is emissive
Browse files Browse the repository at this point in the history
  • Loading branch information
NickAcPT committed Aug 7, 2024
1 parent e621000 commit e621000
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions utils/nmsr-software-rasterizer/src/shader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ impl Debug for ShaderState {
pub struct ShaderState {
pub camera: Camera,
pub texture: Arc<RgbaImage>,
pub emissive_texture: bool,
pub texture_size: (f32, f32),
pub sun: SunInformation,
pub primitive: PrimitiveDispatch,
Expand Down Expand Up @@ -156,6 +157,7 @@ impl ShaderState {
Self::new_with_primitive(
camera,
texture,
false,
sun,
PrimitiveDispatch::Mesh(Mesh::new(parts)),
)
Expand All @@ -164,12 +166,14 @@ impl ShaderState {
pub fn new_with_primitive(
camera: Camera,
texture: Arc<RgbaImage>,
emissive_texture: bool,
sun: SunInformation,
primitive: PrimitiveDispatch,
) -> Self {
let mut result: ShaderState = Self {
camera,
texture_size: (texture.width() as f32, texture.height() as f32),
emissive_texture,
texture,
sun,
primitive,
Expand Down

0 comments on commit e621000

Please sign in to comment.