I have two simultaneous questions - seemingly unrelated, but actually quite related in my addon.
1. gcSetupCustomCamera
I am experimenting with gcAPI (did not try it before) and I can't initialize Custom Camera. The code is quite simple:
void Vostok::clbkVisualCreated(VISHANDLE vis, int refcount)
{
VESSELM::clbkVisualCreated(vis, refcount);
mirPos = zplus; mirDir = zminus; mirUp = yplus;
hMirrorSurf = oapiCreateSurfaceEx(128, 128, OAPISURFACE_TEXTURE | OAPISURFACE_RENDERTARGET | OAPISURFACE_RENDER3D | OAPISURFACE_NOMIPMAPS);
oapiClearSurface(hMirrorSurf);
hMirror = gcSetupCustomCamera(NULL, GetHandle(), mirPos, mirDir, mirUp, 60 * RAD, hMirrorSurf, 255);
DEVMESHHANDLE hMeshVis = GetDevMesh(hVisual, Meshes["mFood"]->iMesh);
oapiSetTexture(hMeshVis, 2, hMirrorSurf);
}
Everything works except for gcSetupCustomCamera - it returns NULL. In both 4.11 (last stable) and 4.18 (last Beta) client. Custom Camera option in client settings is ON. I hope it is just something very simple I am missing here, if anyone can spot it? The problem might be in how I try to use API, not in the client, after all...
2. Reflective materials in cockpit view.
I normally try to work with "latest stable" client - something that addon users will likely have. Here, while trying with latest 4.18 Beta, I saw that reflective materials in the internal cockpit view are working perfectly in this beta client.
Now, what I got from the recent discussion about this feature was (correct me if I am wrong):
- the feature is restored in latest specially rebuilt Client for Orbiter 2010 (R16);
- the feature is not going to be restored in client for 2016 (for quite reasonable considerations on future development problems: what to select and what not to select for rendering, etc.).
Now, here comes the connection. The only reason I am trying out the Custom Camera PI is to try replace the "reflective material" implementation with "custom view render" implementation. So, when I see reflections working again in latest beta:
- is it a one-off attempt, only for Beta?
- will it stay in future Betas?
- did you decide to restore it in the eventual official client, after all? Or you don't know yet?
- if it stays - will it be subject to further development, regarding same consideration (of what to render)? I am asking because my current implementation likely relies on the feature to remain more or less the same
)
In other words, I am trying to figure out whether to proceed with conversion to Custom Camera (which may or may not succeed), how to document the existing clients support for the feature in my next addon update, etc. So, second question is probably more important than the first. But in any case - even if reflective Vzor can safely stay - I'd like to figure out the Custom Camera API, just to be sure I have this tool in my arsenal if/when I need it.
Thanks in advance!