dotnet / dotnet/wpf

ImageBrush (with TileMode as Tile and ViewportUnits as Absolute) as DiffuseMaterial has a wrong behavior.

Open
#6,692 0 comments 1 reaction 1 assignee Claimed by @pchaurasia14 View on GitHub
Investigate
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

* .NET Core Version: 6.0.203
* Windows version: 10.0.19043
* Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes
* Is this bug related specifically to tooling in Visual Studio: No
* Security issues or bugs: No

**Problem description:**

In a `Viewport3D`, we consider the rendering of **the first column** of a texture to a `GeometryModel3D` that represent a square.
That's it, each point of the square `({x,y}∈[0,1]²)` is mapped to `{0,y}` in the texture space.

``` xml























```

If we set the `ImageBrush` `TileMode` to `"Tile"`, it appear that it is the middle column of the texture that is rendered, that's it, each point of the square `({x,y}∈[0,1]²)` is mapped to `{0.5,y}` in the texture space instead of `{0,y}`.

**Actual behavior:**

When the `ImageBrush` `TileMode` is set to `"Tile"`, it is the middle column of the texture that is rendered, that's it, each point of the square `({x,y}∈[0,1]²)` is mapped to `{0.5,y}`.

**Expected behavior:**

When the `ImageBrush` `TileMode` is set to `"Tile"`, it should be the first column of the texture that is rendered, that's it, each point of the square `({x,y}∈[0,1]²)` should be mapped to `{0,y}`.

**Minimal repro:**

Code to reproduce the bug available [here](https://github.com/Orace/WpfGeometryModel3DBug/releases/tag/v0.0.1).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.