OROCHI
 
Loading...
Searching...
No Matches
GxSysRenderBase.h
Go to the documentation of this file.
1//===========================================================================
10//===========================================================================
11#pragma once
12
13GX_CORE_NAMESPACE_BEGIN()
14
16
17#if !defined(ENABLE_LINEAR_Z)
18#define ENABLE_LINEAR_Z 0
19#endif // !ENABLE_LINEAR_Z
20
21#if !defined(_NX64)
22#define USE_MULTISAMPLE_VIEWPORT
23#endif // !_NX64
24
25#if defined(_PS5)
26#define USE_TEMPORARY_RENDER_TARGET 1
27#else //_PS5
28#define USE_TEMPORARY_RENDER_TARGET 0
29#endif // !_PS5
30
31//===========================================================================
33//===========================================================================
35{
36 //-----------------------------------------------------------
38 //-----------------------------------------------------------
40public:
41 // RTTI定義
43 // GxClassBase継承クラス用禁止宣言
45
46
47 //-------------------------------------------------------------
49 //-------------------------------------------------------------
51
55#if defined(GX_USE_FP16MAP)
57#else //GX_USE_FP16MAP
59#endif // !GX_USE_FP16MAP
66#if defined(_PS4) || defined(_PS5)
67 , _useHtileOnShadowBuffer(true)
68 , _useHtileOnDepthStencil(true)
69#if GX_ENABLE_NEO
70 , _useHtileOnDepthStencilNeo(true)
71#endif // GX_ENABLE_NEO
72#endif // _PS4 || _PS5
73 {}
74
76 //-------------------------------------------------------------
78 //-------------------------------------------------------------
80
82 void loadJson(const GxJson::GxJsonNode& jsonNode);
83
85 //-------------------------------------------------------------
87 //-------------------------------------------------------------
89
99
100#if defined(_PS4) || defined(_PS5)
101 b32 _useHtileOnShadowBuffer;
102 b32 _useHtileOnDepthStencil;
103#if GX_ENABLE_NEO
104 b32 _useHtileOnDepthStencilNeo;
105#endif // GX_ENABLE_NEO
106#endif // _PS4 || _PS5
107
109};
110
111//===========================================================================
113//===========================================================================
114class GxSysRenderBase : public GxSysBase, public SingletonBase<GxSysRenderBase>
115{
116 //-------------------------------------------------------------
118 //-------------------------------------------------------------
120public:
121 GX_RTTI_ABSTRACT_CLASS(GxSysRenderBase, GxSysBase)
122 // GxClassBase継承クラス用禁止宣言
124
125 class GxViewport;
126 struct GxVertexData;
127
132
134 //-------------------------------------------------------------
136 //-------------------------------------------------------------
138
140 GxSysRenderBase(void);
142 ~GxSysRenderBase(void) override {}
144 b32 initialize(const GxClassBase* pInitialInformation) override;
146 void terminate(void) override;
147
149 virtual b32 initializeThreadLocalStorage(u32 workerThreadIndex);
150
152 //-----------------------------------------------------------
154 //-----------------------------------------------------------
156public:
158 GX_FORCE_INLINE void setVirtualResolution(GxSize& size) { _virtualResolution._width = size._width; _virtualResolution._height = size._height; }
160 GX_FORCE_INLINE const GxSize& getVirtualResolution(void) const { return _virtualResolution; }
162 GX_FORCE_INLINE const GxSize& getOutputResolution(void) const { if( getGxRenderDevice() ) { return getGxRenderDevice()->getOutputResolution(); } return GxSize::ZERO; }
164 GX_FORCE_INLINE const GxSize& getDefaultViewportResolution(void) const { return _defaultViewportResolution; }
165
167 GX_FORCE_INLINE const GxRect& getSafetyArea(void) const { if( getGxRenderDevice() ) { return getGxRenderDevice()->getSafetyArea(); } return GxRect::ZERO; }
169 GX_FORCE_INLINE const GxRect& getVirtualSafetyArea(void) const { return _virtualSafetyArea; }
170
172 GX_FORCE_INLINE void setClearColor(const GxColor& color) { _clearColor = color; }
174 GX_FORCE_INLINE const GxColor& getClearColor(void) const { return _clearColor; }
175
177 GxViewport* getViewport(RENDER_VIEW index) const { return _pViewport[static_cast<s32>(index)]; }
179 GxViewport* getDisableViewport(void) const;
181 u32 getViewIndex(GxViewport* pViewport) const;
183 u32 getEnableViewportNum(void);
184
186 constexpr GxRenderVertexBuffer* getInstanceVertexBuffer(void) { return _pInstanceVertexBuffer; }
187
189 GX_FORCE_INLINE virtual GxResShaderPackage* getModelShaderPackage(void) { return nullptr; }
190
191#if GX_EDITOR
193 GX_FORCE_INLINE b32 isEnableBakeLightProbe(void) { return _enableBakeLightProbe; }
195 GX_FORCE_INLINE void setEnableBakeLightProbe(b32 enableBakeLightProbe) { _enableBakeLightProbe = enableBakeLightProbe; }
196#endif //GX_EDITOR
197
199 GX_FORCE_INLINE b32 isFrustumCulling(void) const { return _isFrustumCulling; }
201 GX_FORCE_INLINE void setFrustumCulling(b32 enable) { _isFrustumCulling = enable; }
202#if GX_ENABLE_OCCLUSION_CULLING
204 GX_FORCE_INLINE b32 isOcclusionCulling(void) const { return _isOcclusionCulling; }
206 GX_FORCE_INLINE void setOcclusionCulling(b32 enable) { _isOcclusionCulling = enable; }
207#endif //GX_ENABLE_OCCLUSION_CULLING
208#if GX_DEVELOP
210 GX_FORCE_INLINE b32 isCullingLock(void) const { return _cullingLock; }
212 GX_FORCE_INLINE void setCullingLock(b32 enable) { _cullingLock = enable; }
213#endif //GX_DEVELOP
214
216 GX_FORCE_INLINE b32 isShadowCullingModeDefault(void) const { return _shadowCullingModeDefault; }
218 GX_FORCE_INLINE void setShadowCullingModeDefaul(b32 enable){ _shadowCullingModeDefault = enable; }
219
220#if defined(_PS4) || defined(_PS5)
222 GX_FORCE_INLINE b32 isUseHtileOnDepthStencil(void) const { return _useHtileOnDepthStencil; }
223#if GX_ENABLE_NEO
225 GX_FORCE_INLINE b32 isUseHtileOnDepthStencilNeo(void) const { return _useHtileOnDepthStencilNeo; }
226#endif // GX_ENABLE_NEO
227#if GX_ENABLE_HTILE_STENCIL_MASK
229 GX_FORCE_INLINE b32 isHtileStencilMaskEnable(void) const { return _htileStencilMaskEnable; }
231 GX_FORCE_INLINE void setHtileStencilMaskEnable(b32 enable) { _htileStencilMaskEnable = enable; }
233 GX_FORCE_INLINE void setHtileStencilMaskParams(u32 viewIndex, f32 outAngle, f32 inAngle, f32 topAngle, f32 bottomAngle, f32 cutOff, f32 cutOut)
234 {
235 _htileStencilMaskParams[viewIndex][0] = outAngle;
236 _htileStencilMaskParams[viewIndex][1] = inAngle;
237 _htileStencilMaskParams[viewIndex][2] = topAngle;
238 _htileStencilMaskParams[viewIndex][3] = bottomAngle;
239 _htileStencilMaskParams[viewIndex][4] = cutOff;
240 _htileStencilMaskParams[viewIndex][5] = cutOut;
241 }
243 GX_FORCE_INLINE const f32* getHtileStencilMaskParams(u32 viewIndex) const { return _htileStencilMaskParams[viewIndex]; }
244#endif // GX_ENABLE_HTILE_STENCIL_MASK
245#endif // _PS4 || _PS5
246
248 RENDER_VIEW getViewportFromScreen( const GxPoint2& screenPosition );
249
251 //-------------------------------------------------------------
253 //-------------------------------------------------------------
255
257 void update(void) override;
259 virtual void render(void);
260
262 const GxPoint2 transformWorldToScreen( const GxVector3& worldPosition, const RENDER_VIEW viewport, const GxSize* pResolution = nullptr );
264 // スクリーン座標GxVector3版をご利用ください
265 b32 transformWorldToScreen( const GxVector3& worldPosition, GxPoint2& screenPosition, const RENDER_VIEW viewport );
267 b32 transformWorldToScreen( const GxVector3& worldPosition, GxVector3& screenPosition, const RENDER_VIEW viewport );
268
270 const GxVector2 transformWorldToVirtual( const GxVector3& worldPosition, const RENDER_VIEW viewport );
271
273 b32 transformScreenToRay( const GxPoint2& screenPosition, GxVector3& rayStart, GxVector3& rayEnd, const GxSize* pResolution = nullptr );
275 b32 transformScreenToRay( const GxPoint2& screenPosition, GxVector3& rayStart, GxVector3& rayEnd, const RENDER_VIEW viewport, const GxSize* pResolution = nullptr );
276
278 static void getPositionFromVirtual(const GxVector2& virtualPosition, GxPoint2& outputPosition, const GxSize* pOutputResolution);
280 static void getPositionToVirtual(const GxPoint2& inputPosition, GxVector2& virtualPosition, const GxSize* pInputResolution);
282 static void getPositionVirtualToOutput(const GxVector2& virtualPosition, GxPoint2& outputPosition);
284 static void getPositionOutputToVirtual(const GxPoint2& outputPosition, GxVector2& virtualPosition);
286 static void getRectFromVirtual(const GxRectF& baseRect, GxRect& dstRect, const GxSize* pOutputResolution);
288 static void getRectToVirtual(const GxRect& baseRect, GxRectF& dstRect, const GxSize* pInputResolution);
290 static void getRectVirtualToOutput(const GxRectF& baseRect, GxRect& dstRect);
292 static void getRectOutputToVirtual(const GxRect& baseRect, GxRectF& dstRect);
293
295 static GxPoint2 getPositionViewPortToOutput(const GxPoint2& viewportPosition,const RENDER_VIEW viewportNo);
296
298 static GxPoint2 getPositionOutputToViewPort(const GxPoint2& outputResolution,const RENDER_VIEW viewportNo);
299
302
303#if defined(_PS4)
304#if GX_ENABLE_NEO
306 s32 enablePrimIdMapCallback(void* pSource, void* pArgument);
308 s32 disablePrimIdMapCallback(void* pSource, void* pArgument);
309
311 s32 enableNeoRenderModeGradientAdjustCallback(void* pSource, void* pArgument);
313 s32 disableNeoRenderModeGradientAdjustCallback(void* pSource, void* pArgument);
315 s32 enableNeoRenderModeAaSampleLocationCallback(void* pSource, void* pArgument);
317 s32 disableNeoRenderModeAaSampleLocationCallback(void* pSource, void* pArgument);
319 s32 enableNeoRenderModeAaSettingCallback(void* pSource, void* pArgument);
321 s32 disableNeoRenderModeAaSettingCallback(void* pSource, void* pArgument);
322
324 s32 setRenderTargetsForPrimIdGeometryCallback(void* pSource, void* pArgument);
325#endif // GX_ENABLE_NEO
326#endif // _PS4
327
329 constexpr void setClearTexture(GxRenderTexture* pClearRenderTexture) { _pClearRenderTexture = pClearRenderTexture; };
331 constexpr GxRenderTexture* getClearTexture(void) { return _pClearRenderTexture; };
332
333protected:
335 void drawClearTexture(GxViewport* pViewport);
336
337protected:
339 virtual void renderUnit(void);
340
342 void copyViewport(void);
343#if defined(_PS4)
344#if GX_ENABLE_NEO
346 void resolveViewportByNeoRenderMode(void);
347
349 s32 resolveNeoRenderModeCallback(void* pSource, void* pArgument);
350#endif // GX_ENABLE_NEO
351#endif // _PS4
353 virtual GxRenderTexture* getViewportRenderTarget(RENDER_VIEW viewport);
354
356 GX_FORCE_INLINE GxRenderContext* getRenderContext(u32 workerThreadIndex) { return &getGxRenderDevice()->_pContext[workerThreadIndex]; }
357
359 //-------------------------------------------------------------
361 //-------------------------------------------------------------
363private:
364 GxSize _virtualResolution;
365 GxRect _virtualSafetyArea;
366 GxSize _defaultViewportResolution;
367 GxColor _clearColor;
368 GxViewport* _pViewport[static_cast<s32>(RENDER_VIEW::MAX)];
369 GxRenderVertexDeclaration* _pRenderDeclaration;
370 GxRenderVertexBuffer* _pRenderVertexBuffer;
371 GxRenderIndexBuffer* _pRenderIndexBuffer;
372 GxRenderVertexBuffer* _pInstanceVertexBuffer;
373 GxResShaderPackage* _pShaderPackage;
374 GxShaderPackage::GxShaderCode* _pShaderCode;
375 GX_HANDLE _handleProjectionMatrix2D;
376 GX_HANDLE _handleOutputGamma;
377 GX_HANDLE _handleTexture;
378#if GX_USE_HLSL
379 GX_HANDLE _handleNoFilterSamplerState;
380#endif // GX_USE_HLSL
381
382#if GX_EDITOR
383 b32 _enableBakeLightProbe;
384#endif //GX_EDITOR
385
386 b32 _isFrustumCulling;
387#if GX_ENABLE_OCCLUSION_CULLING
388 b32 _isOcclusionCulling;
389#endif //GX_ENABLE_OCCLUSION_CULLING
390#if GX_DEVELOP
391 b32 _cullingLock;
392#endif //GX_DEVELOP
393 b32 _shadowCullingModeDefault;
394
395#if defined(_PS4) || defined(_PS5)
396 b32 _useHtileOnDepthStencil;
397#if GX_ENABLE_NEO
398 b32 _useHtileOnDepthStencilNeo;
399#endif // GX_ENABLE_NEO
400#if GX_ENABLE_HTILE_STENCIL_MASK
401 b32 _htileStencilMaskEnable;
402 f32 _htileStencilMaskParams[static_cast<s32>(RENDER_VIEW::MAX)][6];
403#endif // GX_ENABLE_HTILE_STENCIL_MASK
404#endif // _PS4 || _PS5
405 GxRenderTexture* _pClearRenderTexture;
406
408};
409
410//===========================================================================
412//===========================================================================
414{
415 //-------------------------------------------------------------
417 //-------------------------------------------------------------
419public:
421 // GxClassBase継承クラス用禁止宣言
423 // new, delete定義
424 GX_OPERATOR_NEW_DELETE(GxAllocatorList::ALLOCATOR_TYPE::RENDER)
425
426 friend class GxSysRenderBase;
427
429 //-------------------------------------------------------------
431 //-------------------------------------------------------------
433protected:
435 GxViewport(void);
436
438 GX_FORCE_INLINE virtual b32 initialize(void) { return true; }
440 virtual void terminate(void);
441
443 //-----------------------------------------------------------
445 //-----------------------------------------------------------
447public:
449 virtual void update(void);
450
451protected:
454
456 //-----------------------------------------------------------
458 //-----------------------------------------------------------
460public:
462 GX_FORCE_INLINE b32 getEnable(void) const { return _enable; }
464 GX_FORCE_INLINE void setEnable(b32 enable) { _enable = enable; }
466 GX_FORCE_INLINE b32 isRenderDisplay(void) const { return _isRenderDisplay; }
468 GX_FORCE_INLINE void setRenderDisplay(b32 enable) { _isRenderDisplay = enable; }
470 GX_FORCE_INLINE b32 isOffScreen(void) const { return _isOffScreen; }
472 GX_FORCE_INLINE void setOffScreen(b32 enable) { _isOffScreen = enable; }
474 constexpr GxUnitCameraBase* getCamera(void) const { return _pCamera; }
476 constexpr void setCamera(GxUnitCameraBase* pCamera) { _pCamera = pCamera; }
478 GX_FORCE_INLINE const GxSize& getResolution(void) const { return _resolution; }
480 void setResolution(const GxSize& resolution);
482 constexpr RENDER_FORMAT getFormat(void) const { return _format; }
484 GX_FORCE_INLINE void setFormat(RENDER_FORMAT format) { _format = format; _isChanged = true; }
486 constexpr RENDER_ANTI_ALIASING getAntiAliasing(void) const { return _antiAliasing; }
488 GX_FORCE_INLINE void setAntiAliasing(RENDER_ANTI_ALIASING antiAliasing) { _antiAliasing = antiAliasing; _isChanged = true; }
490 GX_FORCE_INLINE const GxRect& getRegion(void) const { return _region; }
492 GX_FORCE_INLINE void setRegion(const GxRect& region) { _region = region; }
494 GX_FORCE_INLINE void setSize(const GxSize& size) { _region._right = _region._left + size._width; _region._bottom = _region._top + size._height; }
495
497 constexpr GxRenderTexture* getRenderTarget(void) const { return _pRenderTarget; }
499 void setRenderTarget(GxRenderTexture* pTexture);
501 constexpr GxRenderTexture* getDepthStencil(void) const { return _pDepthStencil; }
503 constexpr GxRenderTexture* getShadowMap(void) const { return _pTexShadow; }
505 constexpr GxRenderTexture* getSSAOMap(void) const { return _pTexSSAO; }
507 constexpr GxRenderTexture* getSSAOHorizontalBlurredMap(void) const { return _pTexSSAOHorizontalBlurred; }
509 constexpr GxRenderTexture* getNormalMap(void) const { return _pTexNormal; }
511 constexpr GxRenderTexture* getDiffuseMap(void) const { return _pTexDiffuse; }
513 constexpr GxRenderTexture* getSpecularMap(void) const { return _pTexSpecular; }
515 constexpr GxRenderTexture* getFogColorMap(void) const { return _pTexFogColor; }
517 constexpr GxRenderTexture* getLightProbeMap(void) const { return _pTexLightProbeMap; }
519 void setLightProbeMapResolution(const GxSize& resolution);
521 void setLightProbeResolution(u32 x, u32 y, u32 z);
523 constexpr GxRenderTexture* getLightProbe(u32 shIndex, u32 colorIndex) const { return _pTexLightProbe[shIndex][colorIndex]; }
525 constexpr GxRenderTexture* getMetallicRoughnessMap(void) const { return _pTexMetallicRoughness; }
526#if USE_TEMPORARY_RENDER_TARGET
528 constexpr GxRenderTexture* getTemporaryMap(void) const { return _pTexTemporary; }
529#endif //USE_TEMPORARY_RENDER_TARGET
531 constexpr GxRenderTexture* getVelocityMap(void) const { return _pTexVelocity; }
533 constexpr GxRenderTexture* getVelocityDepthStencilMap(void) const { return _pTexVelocityDepthStencil; }
535 const GxSize& getVelocityMapResolution(void) const { return _velocityMapResolution; }
537 void setVelocityMapResolution(const GxSize& resolution){ _velocityMapResolution = resolution; }
538
539#if ENABLE_LINEAR_Z
541 constexpr GxRenderTexture* getLinearZMap(void) const { return _pTexLinearZ; }
542#endif // ENABLE_LINEAR_Z
544 constexpr GxRenderTexture* getEffectZMap(void) const { return _pTexEffectZ; }
546 constexpr GxRenderTexture* getSemiTransparenceMap(void) const { return _pTexSemiTransparence; }
547
548#if defined(USE_MULTISAMPLE_VIEWPORT)
550 constexpr GxRenderTexture* getMultiSample(void) const { return _pTexMultiSample; }
552 constexpr GxRenderTexture* getMultiSampleDepthStencil(void) const { return _pTexMultiSampleDepthStencil; }
553#endif // USE_MULTISAMPLE_VIEWPORT
554
556 constexpr GxRenderVertexDeclaration* getLightingVertexDeclaration(void) const { return _pLightingVertexDeclaration; }
558 constexpr GxRenderVertexBuffer* getLightingVertexBuffer(void) const { return _pLightingVertexBuffer; }
560 constexpr GxRenderIndexBuffer* getLightingIndexBuffer(void) const { return _pLightingIndexBuffer; }
561
563 b32 isRenderReady(void);
564
566 void clearRenderTarget(RENDER_SUB_VIEW subView, RENDER_PASS pass, u32 subPriority = 0);
567
569 constexpr void setIndex(u32 index){ _viewportIndex = index; }
571 constexpr u32 getIndex(void){ return _viewportIndex; }
572
573#if defined(_PS4) || defined(_PS5)
575 constexpr GxRenderTexture* getFmask(void) const { return _pTexFmask; }
576#if GX_ENABLE_NEO
578 constexpr GxRenderTexture* getPrimIdMap(void) const { return _pTexPrimId; }
579
581 constexpr GxRenderTexture* getAfterResolveRenderTarget(void) const { return _pTexAfterResolveRenderTarget; }
582
584 constexpr GxRenderTexture* getDepthStencilNeo(void) const { return _pDepthStencilNeo; }
585
587 void notifyNeoRenderModeChanged(void);
588#endif // GX_ENABLE_NEO
589#endif // _PS4 || _PS5
590
592 //-------------------------------------------------------------
594 //-------------------------------------------------------------
596private:
597 b32 _enable;
598 b32 _isRenderDisplay;
599 b32 _isChanged;
600 b32 _isOffScreen;
601 u32 _viewportIndex;
602 GxUnitCameraBase* _pCamera;
603 GxSize _resolution;
604 RENDER_FORMAT _format;
605 RENDER_ANTI_ALIASING _antiAliasing;
606 GxRect _region;
607
608 GxRenderTexture* _pRenderTarget;
609 GxRenderTexture* _pDepthStencil;
610 GxRenderTexture* _pTexShadow;
611 GxRenderTexture* _pTexSSAO;
612 GxRenderTexture* _pTexSSAOHorizontalBlurred;
613 GxRenderTexture* _pTexNormal;
614 GxRenderTexture* _pTexDiffuse;
615 GxRenderTexture* _pTexSpecular;
616 GxRenderTexture* _pTexFogColor;
617 GxRenderTexture* _pTexLightProbeMap;
618 GxRenderTexture* _pTexLightProbe[3][3];
619 GxSize _lightProbeMapResolution;
620 u32 _lightProbeResolution[static_cast<u32>(AXIS::MAX)];
621 GxRenderTexture* _pTexMetallicRoughness;
622#if USE_TEMPORARY_RENDER_TARGET
623 GxRenderTexture* _pTexTemporary;
624#endif //USE_TEMPORARY_RENDER_TARGET
625 GxRenderTexture* _pTexVelocity;
626 GxRenderTexture* _pTexVelocityDepthStencil;
627 GxSize _velocityMapResolution;
628
629#if ENABLE_LINEAR_Z
630 GxRenderTexture* _pTexLinearZ;
631#endif // ENABLE_LINEAR_Z
632 GxRenderTexture* _pTexEffectZ;
633 GxRenderTexture* _pTexSemiTransparence;
634
635#if defined(USE_MULTISAMPLE_VIEWPORT)
636 GxRenderTexture* _pTexMultiSample;
637 GxRenderTexture* _pTexMultiSampleDepthStencil;
638#endif // USE_MULTISAMPLE_VIEWPORT
639
640#if defined(_PS4) || defined(_PS5)
641 GxRenderTexture* _pTexFmask;
642#endif //_PS4 || _PS5
643
644 GxRenderVertexDeclaration* _pLightingVertexDeclaration;
645 GxRenderVertexBuffer* _pLightingVertexBuffer;
646 GxRenderIndexBuffer* _pLightingIndexBuffer;
647
648#if defined(_PS4)
649#if GX_ENABLE_NEO
650 GxRenderTexture* _pTexPrimId;
651
652 GxRenderTexture* _pTexAfterResolveRenderTarget;
653
654 GxRenderTexture* _pDepthStencilNeo;
655#endif // GX_ENABLE_NEO
656#endif // _PS4
657
659};
660
661//---------------------------------------------------------------------------
663//---------------------------------------------------------------------------
669
670// アクセスインターフェース
671GX_FORCE_INLINE GxSysRenderBase* getGxSysRenderBase(void) { return GxSysRenderBase::getSingletonPointer(); }
672
673GX_CORE_NAMESPACE_END()
#define GX_PROHIBIT_CLASS_BASE(__CLASS__)
GxClassBase継承の禁止宣言
Definition GxBase.h:240
u32 GX_HANDLE
ハンドル
Definition GxDefine.h:214
@ MAX
定義数
RENDER_VIEW
描画優先度(ビュー)
Definition GxRender.h:442
@ MAX
定義数
RENDER_ANTI_ALIASING
アンチエイリアシング
Definition GxRender.h:382
RENDER_FORMAT
フォーマット
Definition GxRender.h:269
@ R8G8B8A8
R8G8B8A8(B8G8R8A8でもこれを使う。RGBAの並びは抽象化されているので無視してもいい。)
@ R16G16B16A16F
R16G16B16A16F.
RENDER_PASS
描画優先度(パス)
Definition GxRender.h:515
RENDER_SUB_VIEW
描画優先度(サブビュー)
Definition GxRender.h:485
@ RENDER
レンダリング
オブジェクト基底クラス
Definition GxBase.h:88
JSON解析用ノード
Definition GxJson.h:108
static constexpr u32 VALUE_128
128
Definition GxMath.h:126
static constexpr u32 VALUE_64
64
Definition GxMath.h:125
描画コマンドの並列発行を管理します。
Definition GxRenderContext.h:28
GX_FORCE_INLINE const GxSize & getOutputResolution(void) const
出力解像度の取得
Definition GxRenderDevice.h:1017
GX_FORCE_INLINE const GxRect & getSafetyArea(void) const
セーフティエリアの取得
Definition GxRenderDevice.h:1023
初期化クラス
Definition GxRenderDevice.h:46
インデックスバッファを管理する
Definition GxRenderIndexBuffer.h:20
初期化クラス
Definition GxSysRenderBase.h:35
GxSize _defaultViewportResolution
デフォルトビューポート解像度
Definition GxSysRenderBase.h:91
b32 _shadowCullingModeDefault
デフォルトシャドウカリングモード
Definition GxSysRenderBase.h:97
void loadJson(const GxJson::GxJsonNode &jsonNode)
JSONから読み込み
Definition GxSysRenderBase.cpp:50
GxRect _defaultViewportRegion
デフォルトビューポート矩形
Definition GxSysRenderBase.h:94
RENDER_FORMAT _defaultViewportFormat
デフォルトビューポートフォーマット
Definition GxSysRenderBase.h:92
GxSize _shadowMapResolution
シャドウマップ解像度
Definition GxSysRenderBase.h:96
GxRenderDeviceInitialInformation _deviceInitialInformation
デバイス初期化情報
Definition GxSysRenderBase.h:90
RENDER_ANTI_ALIASING _defaultViewportAntiAliasing
デフォルトビューポートアンチエイリアス
Definition GxSysRenderBase.h:93
GxSize _virtualResolution
仮想解像度
Definition GxSysRenderBase.h:95
GxSize _velocityMapResolution
速度マップ解像度
Definition GxSysRenderBase.h:98
テクスチャクラス
Definition GxRenderTexture.h:19
頂点バッファを管理する
Definition GxRenderVertexBuffer.h:20
頂点シェーダに渡す頂点の宣言を管理する
Definition GxRenderVertexDeclaration.h:22
シェーダパッケージリソースクラス
Definition GxResShaderPackage.h:19
システム基底クラス
Definition GxSysBase.h:18
ビューポートクラス
Definition GxSysRenderBase.h:414
constexpr GxRenderTexture * getSSAOHorizontalBlurredMap(void) const
SSAO水平ブラーマップを取得
Definition GxSysRenderBase.h:507
constexpr GxRenderTexture * getMultiSample(void) const
マルチサンプル
Definition GxSysRenderBase.h:550
GX_FORCE_INLINE void setRenderDisplay(b32 enable)
画面に描画するか設定
Definition GxSysRenderBase.h:468
constexpr GxUnitCameraBase * getCamera(void) const
カメラを取得
Definition GxSysRenderBase.h:474
GX_FORCE_INLINE const GxSize & getResolution(void) const
解像度取得
Definition GxSysRenderBase.h:478
constexpr GxRenderVertexBuffer * getLightingVertexBuffer(void) const
ライト用頂点バッファの取得
Definition GxSysRenderBase.h:558
const GxSize & getVelocityMapResolution(void) const
速度マップの解像度取得
Definition GxSysRenderBase.h:535
GxViewport(void)
デフォルトコンストラクタ
Definition GxSysRenderBase.cpp:1248
constexpr GxRenderIndexBuffer * getLightingIndexBuffer(void) const
ライト用インデックスバッファの取得
Definition GxSysRenderBase.h:560
GX_FORCE_INLINE void setEnable(b32 enable)
有効か否かの設定
Definition GxSysRenderBase.h:464
constexpr GxRenderTexture * getDiffuseMap(void) const
ディフューズマップを取得
Definition GxSysRenderBase.h:511
constexpr GxRenderTexture * getFogColorMap(void) const
フォグ色マップを取得
Definition GxSysRenderBase.h:515
constexpr GxRenderTexture * getMetallicRoughnessMap(void) const
メタリック/ラフネスマップを取得
Definition GxSysRenderBase.h:525
constexpr void setCamera(GxUnitCameraBase *pCamera)
カメラを設定
Definition GxSysRenderBase.h:476
void setVelocityMapResolution(const GxSize &resolution)
速度マップの解像度設定
Definition GxSysRenderBase.h:537
GX_FORCE_INLINE void setFormat(RENDER_FORMAT format)
フォーマット設定
Definition GxSysRenderBase.h:484
GX_FORCE_INLINE void setRegion(const GxRect &region)
領域設定
Definition GxSysRenderBase.h:492
constexpr GxRenderTexture * getRenderTarget(void) const
レンダーターゲットを取得
Definition GxSysRenderBase.h:497
constexpr RENDER_ANTI_ALIASING getAntiAliasing(void) const
アンチエイリアシング取得
Definition GxSysRenderBase.h:486
virtual GX_FORCE_INLINE b32 initialize(void)
初期化関数
Definition GxSysRenderBase.h:438
constexpr GxRenderTexture * getNormalMap(void) const
ノーマルマップを取得
Definition GxSysRenderBase.h:509
void setResolution(const GxSize &resolution)
解像度設定
Definition GxSysRenderBase.cpp:1380
void setLightProbeMapResolution(const GxSize &resolution)
ライトプローブマップの解像度設定
Definition GxSysRenderBase.cpp:2018
constexpr GxRenderTexture * getVelocityDepthStencilMap(void) const
速度深度マップを取得
Definition GxSysRenderBase.h:533
constexpr GxRenderTexture * getDepthStencil(void) const
深度ステンシルを取得
Definition GxSysRenderBase.h:501
GX_FORCE_INLINE void setOffScreen(b32 enable)
オフスクリーンにするか設定
Definition GxSysRenderBase.h:472
constexpr u32 getIndex(void)
indexを取得
Definition GxSysRenderBase.h:571
constexpr GxRenderTexture * getLightProbeMap(void) const
ライトプローブマップを取得
Definition GxSysRenderBase.h:517
constexpr GxRenderTexture * getLightProbe(u32 shIndex, u32 colorIndex) const
ライトプローブを取得
Definition GxSysRenderBase.h:523
constexpr GxRenderVertexDeclaration * getLightingVertexDeclaration(void) const
ライト用頂点宣言の取得
Definition GxSysRenderBase.h:556
GX_FORCE_INLINE b32 getEnable(void) const
有効か否かの取得
Definition GxSysRenderBase.h:462
constexpr GxRenderTexture * getSSAOMap(void) const
SSAOマップを取得
Definition GxSysRenderBase.h:505
GX_FORCE_INLINE b32 isRenderDisplay(void) const
画面に描画するか判定
Definition GxSysRenderBase.h:466
GX_FORCE_INLINE void setSize(const GxSize &size)
領域サイズ設定
Definition GxSysRenderBase.h:494
constexpr GxRenderTexture * getMultiSampleDepthStencil(void) const
マルチサンプル深度マップ
Definition GxSysRenderBase.h:552
b32 isRenderReady(void)
描画準備が出来ているかの取得。解像度更新中などの場合 false を返す。
Definition GxSysRenderBase.cpp:1409
constexpr GxRenderTexture * getShadowMap(void) const
シャドウマップを取得
Definition GxSysRenderBase.h:503
virtual void terminate(void)
終了処理
Definition GxSysRenderBase.cpp:1314
GX_FORCE_INLINE const GxRect & getRegion(void) const
領域取得
Definition GxSysRenderBase.h:490
virtual void update(void)
更新処理
Definition GxSysRenderBase.cpp:1367
void clearRenderTarget(RENDER_SUB_VIEW subView, RENDER_PASS pass, u32 subPriority=0)
画面クリア処理
constexpr RENDER_FORMAT getFormat(void) const
フォーマット取得
Definition GxSysRenderBase.h:482
GX_FORCE_INLINE void setAntiAliasing(RENDER_ANTI_ALIASING antiAliasing)
アンチエイリアシング設定
Definition GxSysRenderBase.h:488
void setRenderTarget(GxRenderTexture *pTexture)
レンダーターゲットを設定
Definition GxSysRenderBase.cpp:1395
constexpr GxRenderTexture * getSpecularMap(void) const
スペキュラマップを取得
Definition GxSysRenderBase.h:513
void setLightProbeResolution(u32 x, u32 y, u32 z)
ライトプローブの解像度設定
Definition GxSysRenderBase.cpp:2033
constexpr void setIndex(u32 index)
indexを設定
Definition GxSysRenderBase.h:569
constexpr GxRenderTexture * getSemiTransparenceMap(void) const
半透明マップを取得
Definition GxSysRenderBase.h:546
GX_FORCE_INLINE b32 isOffScreen(void) const
オフスクリーンにするか判定
Definition GxSysRenderBase.h:470
b32 updateRenderTarget(void)
レンダーターゲットの更新
Definition GxSysRenderBase.cpp:1463
描画システムクラス
Definition GxSysRenderBase.h:115
static void getPositionOutputToVirtual(const GxPoint2 &outputPosition, GxVector2 &virtualPosition)
OutputResolution→virtualResolutionに座標変換
Definition GxSysRenderBase.cpp:1062
static void getRectToVirtual(const GxRect &baseRect, GxRectF &dstRect, const GxSize *pInputResolution)
指定Resolution→virtualResolutionに矩形変換
Definition GxSysRenderBase.cpp:1092
virtual void renderUnit(void)
ユニットの描画
Definition GxSysRenderBase.cpp:419
GxViewport * getViewport(RENDER_VIEW index) const
ビューポートの取得
Definition GxSysRenderBase.h:177
static void getRectOutputToVirtual(const GxRect &baseRect, GxRectF &dstRect)
OutputResolution→virtualResolutionに矩形変換
Definition GxSysRenderBase.cpp:1120
GX_FORCE_INLINE void setVirtualResolution(GxSize &size)
仮想解像度の設定
Definition GxSysRenderBase.h:158
~GxSysRenderBase(void) override
デストラクタ
Definition GxSysRenderBase.h:142
constexpr GxRenderTexture * getClearTexture(void)
画面クリア用テクスチャのポインタを取得
Definition GxSysRenderBase.h:331
GX_FORCE_INLINE void setFrustumCulling(b32 enable)
フラスタムカリング有効設定
Definition GxSysRenderBase.h:201
GX_FORCE_INLINE const GxSize & getVirtualResolution(void) const
仮想解像度の取得
Definition GxSysRenderBase.h:160
void copyViewport(void)
ビューポートをコピー
Definition GxSysRenderBase.cpp:476
static void getPositionVirtualToOutput(const GxVector2 &virtualPosition, GxPoint2 &outputPosition)
virtualResolution→OutputResolutionに座標変換
Definition GxSysRenderBase.cpp:1052
b32 transformScreenToRay(const GxPoint2 &screenPosition, GxVector3 &rayStart, GxVector3 &rayEnd, const GxSize *pResolution=nullptr)
スクリーン座標→ワールド座標でのレイ
Definition GxSysRenderBase.cpp:954
GX_FORCE_INLINE void setClearColor(const GxColor &color)
クリアカラーを設定
Definition GxSysRenderBase.h:172
void terminate(void) override
終了処理
Definition GxSysRenderBase.cpp:147
u32 getViewIndex(GxViewport *pViewport) const
ビューインデックスの取得
Definition GxSysRenderBase.cpp:764
b32 initialize(const GxClassBase *pInitialInformation) override
初期化
Definition GxSysRenderBase.cpp:170
GX_FORCE_INLINE const GxSize & getDefaultViewportResolution(void) const
Viewportのデフォルト解像度の取得
Definition GxSysRenderBase.h:164
static constexpr u32 LIGHTING_TILE_WIDTH
ライティングのタイル幅
Definition GxSysRenderBase.h:129
u32 getEnableViewportNum(void)
有効なビューポートの数を取得
Definition GxSysRenderBase.cpp:729
const GxPoint2 transformWorldToScreen(const GxVector3 &worldPosition, const RENDER_VIEW viewport, const GxSize *pResolution=nullptr)
ワールド座標→スクリーン座標(カメラzチェックなし)
Definition GxSysRenderBase.cpp:802
GX_FORCE_INLINE const GxColor & getClearColor(void) const
クリアカラーを取得
Definition GxSysRenderBase.h:174
constexpr void setClearTexture(GxRenderTexture *pClearRenderTexture)
画面クリア用テクスチャを設定
Definition GxSysRenderBase.h:329
void drawClearTexture(GxViewport *pViewport)
画面クリア用テクスチャを描画
Definition GxSysRenderBase.cpp:1186
GX_FORCE_INLINE void setShadowCullingModeDefaul(b32 enable)
シャドウ描画時のカリングにデフォルト設定を有効にするか否か(trueの場合 デフォルト設定のカリング無効時;無効、有効時:フロントフェースカリング)
Definition GxSysRenderBase.h:218
GxViewport * getDisableViewport(void) const
未使用のビューポートを取得
Definition GxSysRenderBase.cpp:747
static void getRectVirtualToOutput(const GxRectF &baseRect, GxRect &dstRect)
virtualResolution→OutputResolutionに矩形変換
Definition GxSysRenderBase.cpp:1110
GX_FORCE_INLINE b32 isShadowCullingModeDefault(void) const
シャドウ描画時のカリングにデフォルト設定か否か(trueの場合 デフォルト設定のカリング無効時;無効、有効時:フロントフェースカリング)
Definition GxSysRenderBase.h:216
GX_FORCE_INLINE GxRenderContext * getRenderContext(u32 workerThreadIndex)
指定スレッドのコンテキストを取得
Definition GxSysRenderBase.h:356
static void getPositionFromVirtual(const GxVector2 &virtualPosition, GxPoint2 &outputPosition, const GxSize *pOutputResolution)
virtualResolution→指定Resolutionに座標変換
Definition GxSysRenderBase.cpp:1027
static void getPositionToVirtual(const GxPoint2 &inputPosition, GxVector2 &virtualPosition, const GxSize *pInputResolution)
指定Resolution→virtualResolutionに座標変換
Definition GxSysRenderBase.cpp:1040
void copyTextureToBackbuffer(GxRenderTexture *pDst, GxRenderTexture *pSrc, b32 isRight)
バックバッファにテクスチャをコピー
Definition GxSysRenderBase.cpp:620
static GxPoint2 getPositionViewPortToOutput(const GxPoint2 &viewportPosition, const RENDER_VIEW viewportNo)
各ビューポートでの2D座標系→OutputResolutionに変換
Definition GxSysRenderBase.cpp:1131
virtual GX_FORCE_INLINE GxResShaderPackage * getModelShaderPackage(void)
モデル用シェーダパッケージを取得(仮)
Definition GxSysRenderBase.h:189
GX_FORCE_INLINE const GxSize & getOutputResolution(void) const
出力解像度の取得
Definition GxSysRenderBase.h:162
constexpr GxRenderVertexBuffer * getInstanceVertexBuffer(void)
インスタンス用の頂点バッファの取得
Definition GxSysRenderBase.h:186
virtual b32 initializeThreadLocalStorage(u32 workerThreadIndex)
スレッドローカルストレージ初期化関数
Definition GxSysRenderBase.cpp:347
virtual void render(void)
描画
Definition GxSysRenderBase.cpp:377
GX_FORCE_INLINE const GxRect & getSafetyArea(void) const
セーフティエリアの取得
Definition GxSysRenderBase.h:167
static GxPoint2 getPositionOutputToViewPort(const GxPoint2 &outputResolution, const RENDER_VIEW viewportNo)
OutputResolution→各ビューポートでの2D座標系に変換
Definition GxSysRenderBase.cpp:1159
GX_FORCE_INLINE b32 isFrustumCulling(void) const
フラスタムカリング有効判定
Definition GxSysRenderBase.h:199
GX_FORCE_INLINE const GxRect & getVirtualSafetyArea(void) const
セーフティエリアの取得(仮想座標系)
Definition GxSysRenderBase.h:169
RENDER_VIEW getViewportFromScreen(const GxPoint2 &screenPosition)
スクリーン座標からビューポート番号を取得
Definition GxSysRenderBase.cpp:774
GxSysRenderBase(void)
コンストラクタ
Definition GxSysRenderBase.cpp:97
void update(void) override
更新
Definition GxSysRenderBase.cpp:363
const GxVector2 transformWorldToVirtual(const GxVector3 &worldPosition, const RENDER_VIEW viewport)
ワールド座標→仮想座標(カメラzチェックなし)
Definition GxSysRenderBase.cpp:912
static constexpr u32 LIGHTING_TILE_HEIGHT
ライティングのタイル高さ
Definition GxSysRenderBase.h:131
static void getRectFromVirtual(const GxRectF &baseRect, GxRect &dstRect, const GxSize *pOutputResolution)
virtualResolution→指定Resolutionに矩形変換
Definition GxSysRenderBase.cpp:1073
カメラ基礎クラス
Definition GxUnitCameraBase.h:20
シングルトン基礎クラス
Definition GxSingleton.h:19
static constexpr GxSysRenderBase * getSingletonPointer(void)
Definition GxSingleton.h:59
Definition GxColor.h:21
2次元浮動小数点数クラス
Definition GxStruct.h:22
3次元浮動小数点数クラス
Definition GxStruct.h:91
座標
Definition GxStruct.h:867
実数矩形
Definition GxStruct.h:1100
矩形
Definition GxStruct.h:951
s32 _bottom
底辺
Definition GxStruct.h:1091
static const GxRect ZERO
(0, 0, 0, 0)
Definition GxStruct.h:964
s32 _top
上辺
Definition GxStruct.h:1089
s32 _left
左辺
Definition GxStruct.h:1088
s32 _right
右辺
Definition GxStruct.h:1090
シェーダコード
Definition GxShaderPackage.h:52
サイズ
Definition GxStruct.h:730
static const GxSize ZERO
0
Definition GxStruct.h:743
s32 _width
Definition GxStruct.h:857
s32 _height
高さ
Definition GxStruct.h:858
頂点構造体
Definition GxSysRenderBase.h:665
GxFloat3 _position
座標
Definition GxSysRenderBase.h:666
GxFloat2 _texCoord
テクスチャ座標
Definition GxSysRenderBase.h:667
2次元ベクトル
Definition GxVector.h:34
3次元ベクトル
Definition GxVector.h:245
32bitブーリアン
Definition GxDefine.h:173