Create procedural texture in c++?

0

Hi, i need create procedural texture like IIndexedMesh from IStatObject, the same way but for 2d texture. Any ideas any examples will be nice :)

질문됨 7년 전194회 조회
3개 답변
0
수락된 답변

I have not tested this yet but I think you can do something like this:

unsigned int tex_id = gEnv->pRenderer->DownLoadToVideoMemory((byte*)bitmap_data, w, h, eTF_R8G8B8A8, eTF_R8G8B8A8, -1,true,2,0,cache_name);

ITexture * tex = gEnv->pRenderer->EF_GetTextureByID(tex_id);

답변함 7년 전
0

Hi new_user_987, thank you !!! You gave to me right road to find answer !!!

Here the code.

int width = 800;
    int height = 800;
byte* pStorage = new byte[width * height * 4];
for (int i = 0; i < height * width * 4; i += 4)
{
pStorage[i] = 0; //Red
pStorage[i + 1] = 255; //Green
pStorage[i + 2] = 255; //Blue
pStorage[i + 3] = 255; //Alpha
}
gEnv->pRenderer->WriteDDS(pStorage, width, height, (width * height * 4), "textures/test.dds", eTF_R8G8B8A8, 1);
delete[] pStorage;
답변함 7년 전
0

Thanks for the great post @REDACTEDUSER

답변함 7년 전

이 게시물은 마감됨: 새 답변, 댓글 및 투표 추가가 비활성화되었습니다.

관련 콘텐츠