Commit 507b9798 authored by D-AIRY's avatar D-AIRY

minor fix

parent 6f264aab
......@@ -12,6 +12,10 @@ const.h
float4 vWinSize;
float4 vNearFarLayers;
}; */
cbuffer CDataScene: register(b3)
{
float4 g_vNearFarInvWinSize;
};
cbuffer CDataCamera: register(b2)
{
// float4x4 mV;
......
......@@ -4,9 +4,9 @@ mtrlskin_base.vs
Базовый рендер анимационных моделей
*/
#include <../struct.h>
#include <../skin.h>
#include <../const.h>
#include "../struct.h"
#include "../skin.h"
#include "../const.h"
//##########################################################################
......
......@@ -43,7 +43,7 @@ float4 main(VSO_SceneCommon IN):COLOR0
float2 vDuDv = g_txDuDv.Sample(g_sScene, IN.vTexUV).xy;
float2 vSceneUV = (vPos.xy * float2(1.0, -1.0) + float2(0.5 / 1024.0, 0.5 / 768.0)) * 0.5 + 0.5;
float2 vSceneUV = (vPos.xy * float2(1.0, -1.0) + g_vNearFarInvWinSize.zw * 0.5) * 0.5 + 0.5;
float2 vSceneUVrefract = vSceneUV + (vDuDv - 0.5) * 0.3; // 0.035
float3 vSceneColor;
......
......@@ -102,7 +102,7 @@ CRenderPipeline::CRenderPipeline(IGXContext *pDevice):
blendDesc.renderTarget[0].blendSrcColor = blendDesc.renderTarget[0].blendSrcAlpha = GXBLEND_SRC_ALPHA;
m_pBlendStateAlpha = m_pDevice->createBlendState(&blendDesc);
m_pSceneShaderDataVS = m_pDevice->createConstantBuffer(sizeof(m_sceneShaderData.vs));
//m_pSceneShaderDataVS = m_pDevice->createConstantBuffer(sizeof(m_sceneShaderData));
m_pSceneShaderDataPS = m_pDevice->createConstantBuffer(sizeof(m_sceneShaderData));
m_pCameraShaderDataVS = m_pDevice->createConstantBuffer(sizeof(m_cameraShaderData.vs));
......@@ -189,7 +189,7 @@ CRenderPipeline::~CRenderPipeline()
mem_release(m_pMainCameraVisibility);
mem_release(m_pSceneShaderDataVS);
//mem_release(m_pSceneShaderDataVS);
mem_release(m_pSceneShaderDataPS);
mem_release(m_pCameraShaderDataVS);
......@@ -235,9 +235,9 @@ void CRenderPipeline::renderFrame()
UINT timeDelta = 16;
static const int *r_final_image = GET_PCVAR_INT("r_final_image");
// m_sceneShaderData.vNearFarLayers =
m_pDevice->setVertexShaderConstant(m_pSceneShaderDataVS, SCR_SCENE);
m_sceneShaderData.vNearFarInvWinSize = float4(gdata::vNearFar, 1.0f / (float)m_uOutWidth, 1.0f / (float)m_uOutHeight);
m_pSceneShaderDataPS->update(&m_sceneShaderData);
//m_pDevice->setVertexShaderConstant(m_pSceneShaderDataVS, SCR_SCENE);
m_pDevice->setPixelShaderConstant(m_pSceneShaderDataPS, SCR_SCENE);
m_cameraShaderData.vs.mVP = SMMatrixTranspose(gdata::mCamView * gdata::mCamProj);
......
......@@ -98,15 +98,15 @@ protected:
struct
{
struct
/*struct
{
SMMATRIX mP;
float4 vTimeDelta;
float4 vWinSize;
} vs;
float4 vNearFarLayers;
} vs;*/
float4 vNearFarInvWinSize;
} m_sceneShaderData;
IGXConstantBuffer *m_pSceneShaderDataVS = NULL;
//IGXConstantBuffer *m_pSceneShaderDataVS = NULL;
IGXConstantBuffer *m_pSceneShaderDataPS = NULL;
struct
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment