The worst thing ever.
I really thing the fact that alpha blended things don''t work in D3D pipeline is really the worst thing ever. I have objects that I need to get more transparent as they get closer to the camera (which is pretty easy). So the alpha value goes down as it reaches the camera, but instead of being able to see what is behind it (which is the point), it just looks like the object gets darker. If I turn off the D3D pipeline, my game drops to 10 to 20 fps and lightmap_add just looks wacked so i''m not using that.
I normally wouldn''t say this but no alpha blending is really supid. You have this super powerful engine with all the new bells and whistles and it can''t even alpha blend. What kind of crap is that? Sorry, it just makes me kinda mad.
I''m sure alpha blending can be done with the D3D pipeline. If you couldn''t have things trasparent, I don''t think D3D pipeline would even be an option. Why would microsoft even make something like the D3D pipeline if it didn''t have one of the most widely used effects in video game history.
I don''t care if there is lightmaps, or invisable BSPs, or super photorealistic landscapes, or anything that I thought was important. I KNOW alpha blending is important, no.. not important.. thats an undertatement.. if PowerRender was lifesupport, I would be dead before I could finish this message. Oh, but don''t worry my corpse would look really pretty and be compatible with a geforce3.
-Rich
The problem with alpha blending is you don''t know the proper order to draw the polygon until AFTER you''ve transformed them to view coordinates.
I don''t know what you''re doing to make your object get darker. I can load up a textured cube in PRO Edit and using alpha blending to see the background. What exactly are you rendering and what methods are used?
I don''t know what you''re doing to make your object get darker. I can load up a textured cube in PRO Edit and using alpha blending to see the background. What exactly are you rendering and what methods are used?
I''ll explain a little of what I''m doing.
I have this overhead racing game, its pretty simple, you have to race down this randomly generated track and try to get the best time.
It has an overhead view of the car (like Combat Cars for the Genesis). The track is made up of road segments (each being a pro file). There is a PRO of a straight piece, a wide turn, a medium turn, and a tight turn. I use an algorithm to place the track segments end to end to make a long turny randomly generated track. (It sort of looks like cement intestines).
Each track segment is angled down a little, so that while your going down the track, you are actually going down hill. This causes the parts of the track that you''ve been on already to come towards the camera (actually, the camera is going towards them).
I thought it would look cool if after you passed over a track segment, it would fade out (become more and more transparent, then finally dissapear when it was about 5 segments away). So I made the render method for each segment be TRANSGOUR_TEXTURED. I have the alpha be 255 default, then I use PR_SetMaterialAlpha to make it fade during the game. This almost works, but instead of the track piece becoming translucent (so you can see whats under it) it just becomes darker. If I turn off D3D pipeline then it looks fine, but the game runs at about 20fps, where-as with D3D on, it can easily sustain 60fps even on slow systems.
-Rich
I have this overhead racing game, its pretty simple, you have to race down this randomly generated track and try to get the best time.
It has an overhead view of the car (like Combat Cars for the Genesis). The track is made up of road segments (each being a pro file). There is a PRO of a straight piece, a wide turn, a medium turn, and a tight turn. I use an algorithm to place the track segments end to end to make a long turny randomly generated track. (It sort of looks like cement intestines).
Each track segment is angled down a little, so that while your going down the track, you are actually going down hill. This causes the parts of the track that you''ve been on already to come towards the camera (actually, the camera is going towards them).
I thought it would look cool if after you passed over a track segment, it would fade out (become more and more transparent, then finally dissapear when it was about 5 segments away). So I made the render method for each segment be TRANSGOUR_TEXTURED. I have the alpha be 255 default, then I use PR_SetMaterialAlpha to make it fade during the game. This almost works, but instead of the track piece becoming translucent (so you can see whats under it) it just becomes darker. If I turn off D3D pipeline then it looks fine, but the game runs at about 20fps, where-as with D3D on, it can easily sustain 60fps even on slow systems.
-Rich
OK. My question then is what are you drawing underneath the track sections, and what order are you drawing them in?
For example if you clear the screen to black, draw the translucent track sections, and then draw a background, the translucent parts will blend with the black screen making it darker, instead of blending with the background which hasn''t been drawn yet. Anything that uses the D3D pipeline is drawn immediately even if it is alpha blended.
If you''re drawing anything translucent, it must be drawn after everything else and in the correct order. For your game it sound like you could sort them easily.
ie Clear screen, draw background, draw cars, draw track, draw particles? (lightmap_add only).
For example if you clear the screen to black, draw the translucent track sections, and then draw a background, the translucent parts will blend with the black screen making it darker, instead of blending with the background which hasn''t been drawn yet. Anything that uses the D3D pipeline is drawn immediately even if it is alpha blended.
If you''re drawing anything translucent, it must be drawn after everything else and in the correct order. For your game it sound like you could sort them easily.
ie Clear screen, draw background, draw cars, draw track, draw particles? (lightmap_add only).
Well, I am drawing the track from the front to the back (which means the transparent parts would be drawn first).. give me a few days to reverse my algorithm and I''ll tell you if it worked. Thank you for your help.
-Rich
-Rich
I reversed the order of things being rendered (so the transparent stuff is rendered last) and it works good now. I guess since it didn''t work in the first place I had assumed that it didn''t work at all. You know what assuming does, it makes an ass out of you and me. Well, I guess in this particular situation it just made an ass out of me.
-Rich
-Rich
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement