Page MenuHomeFeedback Tracker

getTextureInfo: Color From Render2Texture
New, NormalPublic

Description

An effective way for telling if one's camouflage is effective, is by analyzing the color compared to his/her surroundings. getTextureInfo is an effective tool for comparing the color of the surface or other objects around the character with the character's own camouflage. another way of gathering images of one's surroundings is via a camera object following the player, that is constantly looking at his/her surroundings such that it creates a render to texture procedural texture however, when one tries to analyze the color output from the getTextureInfo command, it always returns [1,1,1] which is not as helpful.

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
Engine
Steps To Reproduce

_tv=(random 1) tofixed 7;
_c="camera" camcreate getposatl player;
_c attachto [player,[0,0,2]];
_c setvectordirandup [[0,0,-1],[0,1,0]];
_c camsetfov 1;_c camcommit 0;
_c cameraeffect ["internal","back",_tv];
systemchat str ((gettextureinfo format ["#argb,512,512,1)r2t(%1,1.0)",_tv])#2); // should return [1,1,1]

Additional Information

even if after applying the texture to an object within view of the camera (after render is confirmed):
{player setobjecttextureglobal [_foreachindex,format ["#argb,512,512,1)r2t(%1,1.0)",_tv]]} foreach getobjecttextures player;
still produces the [1,1,1] result.
important note: the above ability to analyze the state of the procedural texture with the gettextureinfo command should occur prior to applying to an object such that one does not have to render the texture to some dummy object just to get this to work.

Event Timeline

debug created this task.Apr 29 2023, 4:47 AM
dedmen added a subscriber: dedmen.May 1 2023, 4:06 PM

Due to the way of how this works, this is VERY unlikely.
The color is usually stored in the texture, pre-calculated when it is converted to PAA.
For UIToTexture the CPU doesn't even have access to texture, so we would have to calculate the average color on the GPU.
I'm quite sure this won't happen

Due to the way of how this works, this is VERY unlikely.
The color is usually stored in the texture, pre-calculated when it is converted to PAA.
For UIToTexture the CPU doesn't even have access to texture, so we would have to calculate the average color on the GPU.
I'm quite sure this won't happen

Have it as optional uiEx parameter, so designer can do this costly calculation only when needed?

Actually pretty sure it should return the background color that you set