View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0003057 | NoesisGUI | Unreal | public | 2024-02-01 08:24 | 2024-03-14 14:40 |
| Reporter | mprey | Assigned To | hcpizzi | ||
| Priority | normal | Severity | minor | ||
| Status | resolved | Resolution | fixed | ||
| Product Version | 3.2 | ||||
| Target Version | 3.2.4 | Fixed in Version | 3.2.4 | ||
| Summary | 0003057: Bound Image Texture Source does not update correctly at runtime | ||||
| Description | Runtime redrawing of a Texture2D is not correctly recognized by Noesis as a change, even with On Notify Changed (See also https://www.noesisengine.com/forums/viewtopic.php?t=3196) | ||||
| Steps To Reproduce | 1) Bind Image Source of a Image control to a BP Texture2D variable | ||||
| Attached Files | |||||
| Platform | Any | ||||
|
When you say you're overwriting the Texture2D object, do you mean that it is the same Texture2D object and you're replacing the internal TextureRHI? |
|
|
That is correct, I am operating on the same object and just calling UpdateResource at the end |
|
|
Sorry this took so long. Could you please try the attached patch? This fixes a similar issue we have when new texture mip levels are streamed in or out. TextureStreaming.patch (2,253 bytes)
Index: NoesisRenderDevice.cpp
===================================================================
--- NoesisRenderDevice.cpp (revision 13468)
+++ NoesisRenderDevice.cpp (working copy)
@@ -102,7 +102,7 @@
}
// End of Texture interface
- FTexture2DRHIRef ShaderResourceTexture;
+ FTextureRHIRef ShaderResourceTexture;
uint32 Width;
uint32 Height;
uint32 NumMipMaps;
@@ -1640,35 +1640,22 @@
{
UTexture2D* Texture2D = (UTexture2D*)InTexture;
Texture = *new FNoesisTexture(Texture2D);
- FTexture2DResource* Resource = (FTexture2DResource*)TextureResource;
- // Usually the RHI resource is ready when we create the texture.
- // However, when we are hot-reloading a texture, UE4 enqueues the
- // creation to the render thread, so we must do the same.
- FTexture2DRHIRef TextureRef = Resource->GetTexture2DRHI();
- if (TextureRef)
- {
- check(Texture->Width >= TextureRef->GetSizeX());
- check(Texture->Height >= TextureRef->GetSizeY());
- check(Texture->NumMipMaps >= TextureRef->GetNumMips());
- Texture->ShaderResourceTexture = TextureRef;
- }
- else
- {
- ENQUEUE_RENDER_COMMAND(FNoesisInstance_InitRenderer)
- (
- [Texture, Resource](FRHICommandListImmediate&)
+
+ auto& TextureReference = InTexture->TextureReference;
+ ENQUEUE_RENDER_COMMAND(FNoesisInstance_InitRenderer)
+ (
+ [Texture, &TextureReference](FRHICommandListImmediate&)
+ {
+ FTextureRHIRef TextureRef = TextureReference.TextureReferenceRHI.GetReference();
+ if (TextureRef.IsValid() && TextureRef->IsValid())
{
- FTexture2DRHIRef TextureRef = Resource->GetTexture2DRHI();
- if (TextureRef)
- {
- check(Texture->Width >= TextureRef->GetSizeX());
- check(Texture->Height >= TextureRef->GetSizeY());
- check(Texture->NumMipMaps >= TextureRef->GetNumMips());
- Texture->ShaderResourceTexture = TextureRef;
- }
+ check(Texture->Width >= TextureRef->GetSizeX());
+ check(Texture->Height >= TextureRef->GetSizeY());
+ check(Texture->NumMipMaps >= TextureRef->GetNumMips());
+ Texture->ShaderResourceTexture = TextureRef;
}
- );
- }
+ }
+ );
}
else if (InTexture->IsA<UTextureRenderTarget2D>())
{
|
|
|
Sorry late for response. Yes this works now, thanks! |
|
|
Brilliant! Marking this as resolved. |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2024-02-01 08:24 | mprey | New Issue | |
| 2024-02-01 08:24 | mprey | File Added: heightmapBP (1).png | |
| 2024-02-01 09:38 | jsantos | Assigned To | => hcpizzi |
| 2024-02-01 09:38 | jsantos | Status | new => assigned |
| 2024-02-01 09:38 | jsantos | Target Version | => 3.2.4 |
| 2024-02-01 17:55 | hcpizzi | Note Added: 0009150 | |
| 2024-02-01 18:42 | mprey | Note Added: 0009151 | |
| 2024-02-28 23:48 | hcpizzi | Note Added: 0009264 | |
| 2024-02-28 23:48 | hcpizzi | File Added: TextureStreaming.patch | |
| 2024-02-28 23:48 | hcpizzi | Status | assigned => feedback |
| 2024-03-14 04:10 | mprey | Note Added: 0009329 | |
| 2024-03-14 04:10 | mprey | Status | feedback => assigned |
| 2024-03-14 14:40 | hcpizzi | Status | assigned => resolved |
| 2024-03-14 14:40 | hcpizzi | Resolution | open => fixed |
| 2024-03-14 14:40 | hcpizzi | Fixed in Version | => 3.2.4 |
| 2024-03-14 14:40 | hcpizzi | Note Added: 0009331 |