Wanted to bump this and also add some clarifications.
The default class to use is Actor.
the include for render target 2d is however obviously missing and must be added to get this to compile.
Not that it does any good, as I cant seem to get it to read anything from any texture material at all.
I’m probably doing something wrong somewhere - probably as simple as not storing the render target in the appropriate variable or not selecting it in the viewport.
it just occurred to me that factually there isn’t anything telling this code that it needs to read the coordinates from the texture I choose - since I haven’t chosen one anywhere…
And, I was 100% correct on that. the new BP created with the new class as the base has a Height-map value you can set from within the level editor.
Not that it works still. the sheer size of the map has the render thread locked 100% of the time of execution… I’ll have to figure out how to implement the non blocking updated buffer correctly.
Anyway, if anyone runs into it again:
- your generated line instead of #include "C_CustomActor.generated.h" -
class AHeightMapReader : public AActor
UPROPERTY(Category = HeightMap, EditAnywhere)
UFUNCTION(BlueprintCallable, Category = "HeightMap|Update")
UFUNCTION(BlueprintCallable, Category = "HeightMap|Texture Helper")
FColor GetRenderTargetValue(float x, float y);