Nothing renders. Without it, lighting happens fine, tiling happens fine, etc. It's only that one line. Also, I've tried using a different texture that I know is loaded. That makes it blank, too. EDIT: Even if I spend weeks on a problem, it always feels like I solve it moments after posting about it here. I really do ask here as a last resort. Turns out I wasn't unbinding the texture before drawing the lights. Prior to this, I was accidentally binding the mapset texture to the lights. It looked fine (because it was being overlayed in the same place), but when I bound the mostly black texture of the font, things got screwey. http://img.waffleimages.com/d200802421abaae3c428e2bfbb7eb92f089bc676/dynamicLighting.png Jo fucked around with this message at 05:03 on Jun 29, 2008 |
|
# ? Jun 29, 2008 04:51 |
|
|
# ? May 11, 2024 11:19 |
|
I'd like to create an object-oriented game framework for my 2D games. (I'm using C++ and DX9.) I've got the basic classes down (Engine, Graphics, Game) and my window opening and initializing Direct3D. So yay for that... Now I'm moving on to a Sprite class, but I'm having difficulty figuring out how to go about things. So far I have something like this, with a few functions for setting and getting the position, velocity, etc. code:
code:
It makes sense to me that a Sprite would handle it's own rendering. And yet somehow, I'm just not able to wrap my mind around it. Ugh. I'd love to see some code examples. So far, all my Googling hasn't turned up much. A lot of crappy code and a lot of non-OOP stuff.
|
# ? Jun 30, 2008 18:05 |
|
Gary the Llama posted:Should the Sprite class handle the rendering or the Player class? You shouldn't have to rewrite code for things that render the same way, but that's not to say you can't have players and any other sort of sprite just call one common sprite draw routine and still be treated as renderables. OneEightHundred fucked around with this message at 21:00 on Jun 30, 2008 |
# ? Jun 30, 2008 20:58 |
|
Gary the Llama posted:Should the Sprite class handle the rendering or the Player class? code:
|
# ? Jul 1, 2008 08:35 |
|
TSDK posted:Neither. You should have a Renderer class that renders (or adds to a deferred render list) Sprite objects passed in. The Player class then has a pointer to a Sprite object.
|
# ? Jul 1, 2008 12:38 |
|
StickGuy posted:I'm not sure how scalable this approach is when you have, for example, many different types of objects that require special rendering techniques. It would get a bit messy to have all of that in one place. In a general sense you could keep that information in the actual Sprite (or RenderableObject or whatever the hell) structure. That would allow you to sort your sprites by rendering technique and still basically localize things in the way TSDK is suggesting. It'd actually be pretty trivial to do something like this if you're using programmable shaders.
|
# ? Jul 1, 2008 13:11 |
|
Paradoxish posted:In a general sense you could keep that information in the actual Sprite (or RenderableObject or whatever the hell) structure. That would allow you to sort your sprites by rendering technique and still basically localize things in the way TSDK is suggesting. It'd actually be pretty trivial to do something like this if you're using programmable shaders.
|
# ? Jul 1, 2008 13:35 |
|
StickGuy posted:I'm not sure how scalable this approach is when you have, for example, many different types of objects that require special rendering techniques. It would get a bit messy to have all of that in one place. In principle, you can just think of the GPU and video memory as a set global variables that the code is setting. No matter how you separate out the code that sets the states and calls the rendering functions, all of the rendering calls have an effect on each other. You can't add in a HeatHaze object into a generic scene graph without considering the effect of the Bloom object that's already in there, or considering at what point your depth pre-pass is going to kick in and set up the depth buffer. By splitting rendering effects up between classes, you're trying to pretend that each entity can be rendered in its own right without consideration to other objects, and so then you'll spend the last third of the project having to remember rules like 'the sky box must be the first object in the scene graph' and 'the water nodes must be after the player nodes'. Both approaches are relatively common in game development, but I tend to prefer the centralised approach in general because it's a bit more 'honest' about what's actually going on, and usually offers better performance and scope for optimisation.
|
# ? Jul 1, 2008 14:30 |
|
What's the benefit of the Direct3D effect framework? I'm using it but only trivialy. I understand one of the benefits is being able to specify multiple techniques per effect but that's about all I understand in terms of differences. I don't really understand the concept of shader passes and I'm not sure if I'm just not doing anything complicated enough in order for their use to make sense to me or if it's because the effect framework is hiding something from me. I also get the impression that an effect (n .fx file) is not at all the same thing as what people generally refer to as effects (ie. bump mapping or something).
|
# ? Jul 1, 2008 22:43 |
|
guenter posted:What's the benefit of the Direct3D effect framework? I'm using it but only trivialy. I understand one of the benefits is being able to specify multiple techniques per effect but that's about all I understand in terms of differences. quote:I also get the impression that an effect (n .fx file) is not at all the same thing as what people generally refer to as effects (ie. bump mapping or something).
|
# ? Jul 1, 2008 23:17 |
|
OneEightHundred posted:I'm not saying that there needs to be a better way to do a kick vote, if anything I think kick votes have repeatedly proven their uselessness. Compulsory voting would be far too easily abusable for griefing. I've always been a fan of the Puzzle Pirates Blackspot system, in that it lets players punish others . . . but only players with significant standing in the game already, and abuse is punishable, and it's all logged.
|
# ? Jul 2, 2008 16:40 |
|
TSDK posted:Both approaches are relatively common in game development, but I tend to prefer the centralised approach in general because it's a bit more 'honest' about what's actually going on, and usually offers better performance and scope for optimisation.
|
# ? Jul 4, 2008 12:07 |
|
Is there a XNA alternative for mac development? I'm really into making simple 2d games and have been dabbling in AS3 and Python, but I'm looking for something a little more powerful. I'd also prefer something which could be used on both Mac and Windows after being compiled.
|
# ? Jul 6, 2008 23:39 |
|
Hanpan posted:Is there a XNA alternative for mac development? I'm really into making simple 2d games and have been dabbling in AS3 and Python, but I'm looking for something a little more powerful. Have you looked at the options available for Python? I know there are a couple 3D engines under Python, and those would be cross-platform, generally.
|
# ? Jul 7, 2008 00:28 |
|
Hanpan posted:Is there a XNA alternative for mac development? I'm really into making simple 2d games and have been dabbling in AS3 and Python, but I'm looking for something a little more powerful. If you want to make simple 2d games you should look into Slick for Java. It's a 2d games library which uses OpenGL, so the games should work on Win / *nix and OSX. It seems like it can make some pretty cool 2d games. You can even put your games in Java applets for web play. It's pretty cool if you aren't worried about using Java, and if you want to dabble in OpenGl you can do some pretty cool shader stuff in addition to whats provided in the libraries. Have a look here: http://slick.cokeandcode.com/
|
# ? Jul 7, 2008 09:06 |
|
My only real gripe with using Java is that performance is always going to be an issue and I'm not the most advanced coder in the world. It seems that Java / Flash / Python are my only real option for Mac development though.
|
# ? Jul 7, 2008 13:10 |
|
Hanpan posted:My only real gripe with using Java is that performance is always going to be an issue and I'm not the most advanced coder in the world. It seems that Java / Flash / Python are my only real option for Mac development though.
|
# ? Jul 7, 2008 15:46 |
|
You could try Ogre3D and Irrlicht.
|
# ? Jul 7, 2008 16:38 |
|
OneEightHundred posted:You could try Ogre3D and Irrlicht. I'd say Irrlicht over Ogre3D if he's looking for an XNA comparable framework. Ogre3D isn't exactly super super easy to use, and that's one of the benefits you'd get from XNA.
|
# ? Jul 7, 2008 17:23 |
|
When I say 2D game, I mean everything will be sprite / pixel based. I assume Unity is not good for things like that.
|
# ? Jul 7, 2008 17:33 |
|
It's not really that hard to make a 2D game in a 3D engine, just keep the camera pointed down one axis and make sure you never give anything a velocity or position that'll move it off of that plane. Or put a pair of invisible walls up. Use camera-aligned sprites for graphics (which practically every 3D engine supports). If anything it gives you some artistic flexibility if you ever want to make any elements of it 3D even if the gameplay is strictly 2D.
|
# ? Jul 7, 2008 20:56 |
|
Hanpan posted:When I say 2D game, I mean everything will be sprite / pixel based. I assume Unity is not good for things like that. Pygame, then, is pretty much exactly what you want.
|
# ? Jul 7, 2008 22:14 |
|
Thanks guys, sorry for the lack of specifics in my question. I'll give pyGame a try.
|
# ? Jul 7, 2008 22:54 |
|
is there any way to use glMultiDrawElements with VBOs? Specifically I would like to store my index and count arrays on GPU memory, but still use this call. Is this even possible? EDIT: I checked and it worked with VBOs but indecies were still on client side. vvvvvvvvvvvvvvvvvvvvvvvvvv I use OpenGL bindings with Java and have noticed any performance issues, outside of my program taking a couple more seconds on initial load. From what little FPS measurements I did of Java and C++ equivalent OGL programs they were the same. Entheogen fucked around with this message at 00:45 on Jul 8, 2008 |
# ? Jul 7, 2008 23:00 |
|
Hanpan posted:My only real gripe with using Java is that performance is always going to be an issue and I'm not the most advanced coder in the world. It seems that Java / Flash / Python are my only real option for Mac development though. It's cool that you are using pygame, but I just wanted to clear something up. For pretty much any game you are going to be working on by yourself or in a small group that is not AAA Java is fine. Performance wise it is slower then C++, but given the scope of the game you are making this will not be a problem. I work in the industry, and professionally I use C++ with Direct X, and it's great. The performance is nice and it allows for things that are impossible in languages like Java. But for all of my home projects I use Java. It's not as fast, but I find iteration and development time decreased by at least one order of magnitude when I program with it. I find it a lot easier to finish and deploy personal indie projects by using Java. And more of an audience can play them. My personal feeling is that if you are careful Java is a much better way to aproach indie development then C++. I find it slower, but not slow at all.
|
# ? Jul 8, 2008 00:26 |
|
Stramit posted:It's cool that you are using pygame, but I just wanted to clear something up. For pretty much any game you are going to be working on by yourself or in a small group that is not AAA Java is fine. Performance wise it is slower then C++, but given the scope of the game you are making this will not be a problem.
|
# ? Jul 8, 2008 03:41 |
|
Scaevolus posted:This is true. Also, Python is slower than both Java and C++. PyGame works because the performance critical bits (drawing sprites...) are written in C, while the game logic is written in Python. Which is also the same reason that OpenGL in Java is fast as well. It uses native code for all the OpenGL calls.
|
# ? Jul 8, 2008 05:48 |
|
Entheogen posted:is there any way to use glMultiDrawElements with VBOs? Specifically I would like to store my index and count arrays on GPU memory, but still use this call. Is this even possible? OneEightHundred fucked around with this message at 07:21 on Jul 8, 2008 |
# ? Jul 8, 2008 07:19 |
|
Hanpan posted:Thanks guys, sorry for the lack of specifics in my question. I'll give pyGame a try. Sorry to muddy the waters, but if you're after easy movement to XNA (being c# based and all) you could try sdl.net with mono on mac. I tried it and it was fairly nice, but quite sparse.
|
# ? Jul 8, 2008 08:25 |
|
I'm late to the party but the following is an excellent article covering all of the problems with the various timing methods. http://www.geisswerks.com/ryan/FAQS/timing.html xgalaxy fucked around with this message at 10:47 on Jul 11, 2008 |
# ? Jul 11, 2008 10:35 |
|
I am making graphics for games at my start up game studio here -> http://www.transhumandesign.com But I am still interested in making games with other people. Anyone here good at programming and feel like making games? For free or to sell, whatever. Portfolio -> http://www.sigvatr.com/portfolio Email me at me (at) sigvatr [dot] com if you're interested.
|
# ? Jul 11, 2008 18:20 |
EDIT:
Jo fucked around with this message at 17:48 on Jul 12, 2008 |
|
# ? Jul 12, 2008 02:45 |
|
I'm writing a GUI library for XNA as part of a game that I'm writing as a hobby / learning experience. I made a Container class that is basically a scrollable window. I started using the ScissorRectangle propery of the graphics device to clip anything that gets outside of the bounds of the window. But since the containers can be rendered with rounded corners, I wanted it to be a bit more flexibile. I had an idea to use HLSL and make a certain color a special transparent color. I could shape it to be rounded to fit on the corners of a window, and then when I make a pass through the effects, it would make anything that matches that special color into a transparent pixel. The GUI rendering is part of its own sprite batch, so anything in the game would still show up around the rounded edges. The problem I ran into is this: it appears that the HLSL effect is applied to each sprite as it is drawn, and not applied to the spritebatch as a whole. So my technique doesn't work as planned and instead it just works like a normal transparent sprite. Is there a way to apply the effect to the entire spritebatch after all the sprites have been drawn? Edit: After some more digging, I think I found the answer to my own question. Render the scene onto a separate buffer, get that as a texture, then render it onto the main buffer and apply the effect. http://msdn.microsoft.com/en-us/library/bb313868.aspx Namgsemterces fucked around with this message at 05:39 on Jul 15, 2008 |
# ? Jul 15, 2008 04:52 |
|
Namgsemterces posted:I had an idea to use HLSL and make a certain color a special transparent color.
|
# ? Jul 16, 2008 01:25 |
|
OneEightHundred posted:You could use the alpha channel for that... Thanks, but you didn't understand my question. If I try to cover up an area inside my clipping rectangle but outside of the area I want rendered (note: I'm talking about non-rectangular shapes, like a rounded rectangle) with something of alpha 0, the part I want covered up would still show up because the alpha 0 would be meaningless. I need to overwrite that rounded area with something that is opaque and then later change that opaque color to an alpha 0. Basically, I'm talking about a mask. It would be easier to explain with images, but I'm feeling lazy and I already found a working answer, so I'm not going to bother.
|
# ? Jul 16, 2008 06:05 |
|
Namgsemterces posted:Thanks, but you didn't understand my question. If I try to cover up an area inside my clipping rectangle but outside of the area I want rendered (note: I'm talking about non-rectangular shapes, like a rounded rectangle) with something of alpha 0, the part I want covered up would still show up because the alpha 0 would be meaningless. I need to overwrite that rounded area with something that is opaque and then later change that opaque color to an alpha 0. Basically, I'm talking about a mask. Of course, you could also use the stencil buffer, which is designed for this sort of thing.
|
# ? Jul 16, 2008 16:36 |
|
Namgsemterces posted:Basically, I'm talking about a mask.
|
# ? Jul 16, 2008 17:16 |
|
OneEightHundred posted:You'd write to the framebuffer with 1.0 alpha and render with a blend function that multiplies the source color with the destination alpha. I did some quick reading on the stencil buffer and it looks like that's the best method. I'll scrap that other stuff. Thanks.
|
# ? Jul 16, 2008 18:08 |
|
Hullo, My friend and I are both looking to make a 2d top down scrolling shooter but with 3d graphics. I am looking for advice on what programming language to use. We are both artists with only basic programming knowledge and due to our problems in finding a programmer nearby we have decided to learn to code it ourselves. I've read the sticky and looked into Pygame, but the screenshots on their site seem to be lacking in much 3d. We are willing to learn pretty much anything, but would like it to be the most appropriate and useful to us perhaps in the future. The game will probably have a fairly static camera the majority of the time, with the majority of objects on the screen being 3d. As per the genre there would be alot of poo poo going on, I have heard some languages are slightly slower than others, I have no idea if this would effect us though I would guess it would depend more upon the quality of programming and how resource heavy the art assets were. Obviously I am doing my own research, but i'd like thoughts from some people who know what they're talking about, any advice is appreciated thanks!
|
# ? Jul 17, 2008 17:56 |
|
|
# ? May 11, 2024 11:19 |
|
Squido posted:Hullo, My friend and I are both looking to make a 2d top down scrolling shooter but with 3d graphics. I am looking for advice on what programming language to use. If the camera is fairly static, have you considered having a 2D game with pre-rendered sprites (taken from 3D models) or is that not possible? It could save you a lot of trouble in the long run, but if that's not possible you could look into XNA.
|
# ? Jul 17, 2008 19:30 |