• Advertisement
  • entries
    707
  • comments
    1173
  • views
    434670

Yay, screenshots again!

Sign in to follow this  

119 views


Ethereal Darkness Interactive Update

Came up with an ok puzzle idea. Launch date is approaching, so I need to speed up majorly. That is all.



DragonForge Technology

I got a basic effect running in the shader system. Here are some screenshots in no particular order:

Left quad is rendered after inversion (Invert.fx)
Right is rendered with no shader


This one is rendered using sin() with the color and y texture coordinate multiplied by a value (100 for red, 200 for green, 300 for blue.)


This one is a little more advanced. I put a texture into the system and then use sin() to modify the texture's v coordinate by its u coordinate.



These were made using just the base shader class

Also got my screenshot system plugged in. Its customizeable (of course, what do I make that isn't.) You can specify the format of the filename using several tags:

%userstring% -
Puts the string that the app passes in (useful for putting a
character's name in the screenshots filename or something like
that.)

%date% -
Puts the date into the filename

%time% -
Puts the time into the filename

%index% -
Inserts the current screenshot index.

---------------------
For example, the above screenshots use this format string:
Screenshots/%Date%_%Time%_%Index%.png


Yea, its kind of useless, but this engine isn't being made to be useful =TH

Ok, so it is, but I find this feature pretty useful and it doesn't slow taking a screenshot down very much (I didn't notice and difference at all.)

On a side note - Microsoft needs to remove their redundant messages (i.e. ignoring rendundant state change), its slows everything down way bad (I'm getting a shitload of them, but thats probably because I'm using the shaders wrong or something.)



Discussion





Other news



Sign in to follow this  


2 Comments


Recommended Comments

Awesome - movie time too =D. I modified the shader for the last demo and came up with this:

movie

Here is the source:

//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Headers
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#include "dft/include/dftCommon.h"
#include "dft/include/dftGraphics.h"
#include <iostream>

//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Global variables
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
dft::HtmlLog g_Log;
HWND g_WndHandle = 0;
dft::Graphics g_Graphics;
dft::FrameRateTimer g_FrameRateTimer;

//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Function prototypes
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int);
LRESULT CALLBACK WndProc(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam);
bool LogListener(const std::string& Text, int nType);

//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
if(AllocConsole())
{
freopen("CONOUT$", "r+", stdout);
freopen("CONOUT$", "r+", stderr);
freopen("CONIN$", "w", stdin);
}

g_Log.Create("dftlog.html", "DragonForge Technology : Project Asrion - Debug Log", "style.css");
g_Log.SetUserListener(LogListener);
dft::HtmlLog::SetCurrentLog(&g_Log);

dft::HtmlLog::GetCurrentLog()->StartSection("Initialization");

WNDCLASS WndClass;
ZeroMemory(&WndClass, sizeof(WNDCLASS));
WndClass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
WndClass.hCursor = LoadCursor(0, IDC_ARROW);
WndClass.hIcon = LoadIcon(0, IDI_APPLICATION);
WndClass.hInstance = GetModuleHandle(0);
WndClass.lpfnWndProc = WndProc;
WndClass.lpszClassName = "dftRenderWindow";
if(!RegisterClass(&WndClass))
return 0;

g_WndHandle = CreateWindowEx(0, WndClass.lpszClassName, WndClass.lpszClassName, WS_OVERLAPPEDWINDOW, 0, 0, 800, 600, 0, 0, GetModuleHandle(0), 0);
if(!g_WndHandle)
return 0;

RECT Rect = {0, 0, 800, 600};
AdjustWindowRect(&Rect, WS_OVERLAPPEDWINDOW | WS_VISIBLE, false);
MoveWindow(g_WndHandle, 0, 0, Rect.right - Rect.left, Rect.bottom - Rect.top, TRUE);
ShowWindow(g_WndHandle, SW_SHOWNORMAL);
dft::HtmlLog::GetCurrentLog()->LogDebugOutput("Created window - Window{ <font class=Parameter>Text</font>=<font class=ParamValue>\"%s\"</font> <font class=Parameter>Width</font>=<font class=ParamValue>\"%i\"</font> <font class=Parameter>Height</font>=<font class=ParamValue>\"%i\"</font> }", dft::DOT_TEXT, WndClass.lpszClassName, Rect.right - Rect.left, Rect.bottom - Rect.top);


g_Graphics.Enumerate();
g_Graphics.Create(g_WndHandle);

dft::RenderStateManager::GetSingleton()->SetDeviceComPtr(g_Graphics.GetDeviceComPtr());
dft::SamplerManager::GetSingleton()->SetDeviceComPtr(g_Graphics.GetDeviceComPtr());

dft::Texture::SetGraphicsPtr(&g_Graphics);
dft::Texture* pTexture = dft::Texture::LoadTexture("test.bmp", "ShaderTex");

dft::Shader::SetGraphicsPtr(&g_Graphics);
dft::Shader* pShader = dft::Shader::CreateShader("Invert.fx", "Invert");

D3DXHANDLE hShaderTex = pShader->GetComPtr()->GetParameterByName(0, "Tex");
pShader->GetComPtr()->SetTexture(hShaderTex, pTexture->GetComPtr());

D3DXHANDLE hTimerSlow = pShader->GetComPtr()->GetParameterByName(0, "fTimerSlow");
float fTimer = 1.0f;

dft::DelayTimer Timer;
Timer.SetDelay(100);

if(pShader != 0)
{
MSG Msg;
ZeroMemory(&Msg, sizeof(MSG));
while(1)
{
if(PeekMessage(&Msg, 0, 0, 0, PM_REMOVE))
{
if(Msg.message == WM_QUIT)
break;

TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
else
{
pShader->GetComPtr()->SetFloat(hTimerSlow, fTimer);
if(Timer.Update())
fTimer += 0.1f;

if(g_FrameRateTimer.Update())
{
char szFrameRate[128];
sprintf(szFrameRate, "%i", g_FrameRateTimer.GetFrameRate());

Share this comment


Link to comment
Hey, that's pretty cool. Especially the last shader image/movie. I think I might have to start looking into this "shad0r" business that seems to be the new craze. :P

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement