• entries
707
1173
• views
434744

# Untitled

81 views

HUZZAH, SUCCESS...AGAIN!

Got per-pixel lighting implemented; supports 6 lights at the moment, but I might add more. Really simple stuff at the moment (just basic lights), but I'm going to be adding more stuff.

Back to work; lots to do now.

-edit-
Wtf, I get this done and no more than 5 minutes later, the game breaks. I haven't touched anything; I was just playing around with the lights and boom all of a sudden no textures. After a restart now I've got pink lines running through my screen. I've checked everything I can think of, but nothing fixes it.

-edit-
Fixed the problem. Only took me two and a half hours -_-. I guess I'll explain just in case any of you run into it.

My engine class is setup like so:
class Engine{public:	Engine();	~Engine();	bool SetUp(const std::string AppName, int Width = 0, int Height = 0, bool Windowed = true);	void TakeScreenshot();	bool IsIdle();	void Update();		void PreFrame()	{		GfxDevice.ComPtr->Clear(0, 0, D3DCLEAR_TARGET, Graphics::Color::Black, 1.0, 0);		GfxDevice.ComPtr->BeginScene();	}	void PostFrame()	{		GfxDevice.ComPtr->EndScene();		GfxDevice.ComPtr->Present(0, 0, 0, 0);	}	Rectangle GetScreenRectangle() const;};

So I'm rendering the scene to a texture and then rendering that texture to the screen using shaders. Here's some pseudo of how I'm doing it:
SetRenderTarget(ScreenTexture);Engine->PreRender();RenderScene();Engine->PostRender();SetRenderTarget(BackBuffer);Engine->PreRender();RenderScreenQuad();Engine->PostRender();

The problem being that I'm calling PostRender() twice, which call's Present() twice. The part I find really lovely is that it worked for more than a day and then broke out of nowhere.

Anyway, it's fixed now and I'm back on my way.

-edit-
movie4u

Any good articles on per-pix lighting? I'd like to read over what you've found on it. Great job!

Man this is coming along great! I was just wondering where do you learn this? Do you looks at some Tutorials or try to figure some stuff on your own? because i am really trying to find some articles/tutorials on creating an HUD in Java. If you could give me some advice, or article or something i would appreciate it:)If not thats ok, cuz the game looks great:D

Quote:
 Original post by ildave1 Any good articles on per-pix lighting? I'd like to read over what you've found on it. Great job!

Hey Dave! Sorry, but I don't have any articles. I figured most of it out on my own. However, once I get the lighting the way I want it, I'll go through and explain it all in a post.

Quote:
 Original post by Swattkidd Man this is coming along great! I was just wondering where do you learn this? Do you looks at some Tutorials or try to figure some stuff on your own? because i am really trying to find some articles/tutorials on creating an HUD in Java. If you could give me some advice, or article or something i would appreciate it:)If not thats ok, cuz the game looks great:D

Most of the stuff I've learned is through trial and error. However, I did learn a lot from Raymond (EDI) when I was working with him on The Lost City of Malathedra. A lot of my engine design actually came from him (how I track my resources, most of my shader system design, and probably a few other things I can't think of.)

To be honest, there are very few good articles on game design topics; you usually have to find books or someone that describes things really well in their blog.

I'm not quite sure what you mean by "creating a hud". If you can explain a little more, I'll do my best to help you!

Thanks for the replies guys!

Thanks for the advice, im thinking of going and looking for a nice book..

Also about the HUD, i mean like how you have the Skin on your windows and and all your buttons and all, How exactly did you do that? Like where it displays how much bullets you have, and when you push pause, that window comes up with options, is that just a window, pane or something?

Quote:
 Original post by Swattkidd Thanks for the advice, im thinking of going and looking for a nice book.. Also about the HUD, i mean like how you have the Skin on your windows and and all your buttons and all, How exactly did you do that? Like where it displays how much bullets you have, and when you push pause, that window comes up with options, is that just a window, pane or something?

Ah, my whole GUI. To be honest, I can't really help you =/. I'm awful at explaining things. Your best bet would be to ask on the forums about graphical user interfaces in Java. Sorry [depressed]