• Ищем качественного (не новичок) разработчиков Xenforo для этого форума! В идеале, чтобы ты был фулл стек программистом. Если у тебя есть что показать, то свяжись с нами по контактным данным: https://t.me/DREDD

Исходник Mirrorcam (ported to window)

Забаненный
Забаненный
Статус
Оффлайн
Регистрация
17 Сен 2017
Сообщения
41
Реакции
20
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
I haven't seen public code of mirrorcam ported to window, only some attempts
MDSuolX.png

Steps:
1. Create texture for custom render target
2. In RenderView after rendering normal view, render our mirrorcam to texture
3. Use our texture in UI renderer - directly in RenderView, in PaintTraverse or in D3D renderer.

We won't use raw DirectX functions to achieve it (in queued graphics mode it won't work properly at all probably), but engine's materialsystem.

Classes:

Code:

Step 1. Create render target
Engine heavily discourage us from allocating new render targets when game is already initialized, but we can force it and I haven't got any problems with it.
Code:

You can try to skip EndRenderTargetAllocation, everything works fine that way for me and you don't get stutter on allocation (EndRenderTargetAllocation simulates alt+tab).

Step 2. Render mirrorcam to texture
We will render custom views in RenderView hook.
Code:

After applying this step your FPS should drop (indicator that we're rendering second view), but there should be nothing new on screen - because you're rendering to off-screen texture.

Step 3. Render texture using materialsystem
Now we need to draw mirrorcam to screen. The texture can be accessed by name in materials:
Code:

You can create that material just like you're doing it for chams (if you don't know how look at forums for this). We can now render rectangle on screen using that material:
Code:

You can render it directly after RenderView or in PaintTraverse if you do UI there. Anywhere during engine rendering should work (probably). This way cannot be used in EndScene or Present.
Step 3B. Alternative: Render using raw DirectX
My UI renderer uses D3D and I wanted to use texture there. You can find DirectX texture in ITexture (CTexture):
Code:
 
Последнее редактирование:
thanks for guide
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Oh,nice
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Full pasted from UC -_-
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Назад
Сверху Снизу