REQ: More control over renderstates

Blitz3D Forums/Blitz3D Programming/REQ: More control over renderstates

Tom(Posted 2006) [#1]
Hi,

I've emailed both Mark & Skid over this but unfortunately had no reply as of yet. On the off chance you guys haven't received my emails, I'll ask here.

What I'm after is a way for RenderWorld to NOT change the following D3D renderstates

D3DRENDERSTATE_ZENABLE
D3DRENDERSTATE_ZWRITEENABLE
D3DRENDERSTATE_ALPHABLENDENABLE

Obviously they have to be changed when rendering B3D entitys depending on their alpha status e.t.c, but to do things like stencil shadows it's crucial to have them remain in the user specified state when RenderWorld is called.

If I may suggest a way to implement it, give RenderWorld a second parameter with default values like so:

RenderWorld([tween = 1, keep_user_renderstates = false])

This will not break any existing code!

If keep_user_renderstates = true, then simply do not call SetRenderState() in the RenderWorld loop (other than to setup the texture units).

I'm getting excellent FPS rates doing realtime stencil shadows and I'm 99% ready to release this system freely, but the code has to be hacky in some areas, and some methods will not work because I can't disable the zbuffer or zwrites.

Skid has emailed me to indicate he'll look into having B3D specifically create a stencil capable zbuffer, and I appreciate that (and others will too when they see how cool this stuff is :) but can you please look into this renderstate stuff also.


Thanks
Tom


KuRiX(Posted 2006) [#2]
That should be great, indeed... and not too difficult to do for blitz research!.


Mustang(Posted 2006) [#3]
Well obviously this gets my vote too! ... but I'm not going to hold my breath while I wait. :)


Tom(Posted 2006) [#4]
I think the BRL gods do pay attention, they just have a lot to listen to.

It wouldn't take but a few minutes to implement my method, just copy the main gubbins of the render loop, and chop out any non-texture specific setrenderstate calls, and chuck in an if/else.

Gimme da source and I'll do it :P


Ross C(Posted 2006) [#5]
Cool man, hope this is successful. Blitz3d still has plenty of life in it!


Stevie G(Posted 2006) [#6]
Nice one Tom!

Come on BRL ... please help the man out :) A shadow solution could extend the life of B3d beyond what you ever thought possible. This can only be a good thing.

Stevie


Tom(Posted 2006) [#7]
While on the subject, I've managed to figure out blitz 3ds entity/mesh structure and plan to do as much as possible inside a DLL for speed.

From just an entity handle, I can access all vertex weight info so in theory it should be possible to cast from skinned animated meshes.

There's other things to look into as well, with just 4 pokes, you can point an entitys mesh pointers to a different vertex/tri list.

Think... load mesh/skinned mesh, pre calc 'x' levels of LOD, then a simple function to change an entitys mesh data pointer based on it's cam distance. Realtime LOD with no overhead what so ever.

You can remove tris from a mesh without having to rebuild it in 2 ways, quick hack one is to set tri vert indexes 1&2 to same as 0. Well, it's novel if nothing else :P


Life in the old dog yet!
Tom


Ross C(Posted 2006) [#8]
Definetly. That sounds like an interesting thing. Super fast access to the mesh structure :o) Oh, another thing Tom, did anything ever come of the render to texture? Or DXTC you messed about with?


Tom(Posted 2006) [#9]
Render to Texture is working, still requires you hijack a B3D texture though :)

DXTC I'm looking at again as I have ATI now, and my wifes PC uses NVidia, so I can test it better.


Ross C(Posted 2006) [#10]
Man, this could be awesome :o) I hope you make yourself a wee bit of cash from this :o)


Picklesworth(Posted 2006) [#11]
I agree :)

There are lots of little things like this that could really improve Blitz3d overall.


t3K|Mac(Posted 2006) [#12]
yeah, blitz is still alive and kicking!!!


Mustang(Posted 2006) [#13]
This thread includes basically (pun intended) everything I want to add to Blitz3D except tangent space normals... sure would give a new life to old Blitz if Tom could add everything he has!


Mikele(Posted 2006) [#14]
We need this. Old Blitz3d is still good engine.
Good work Tom! I used your old library (anisotropic filtering, clipping) but what about antialias? Is it possible with your new lib?


jfk EO-11110(Posted 2006) [#15]
Of course it would be great if BRL would add such features to Blitz3D, although I wouldn't mind if they won't do so, for the sake of a good launch of Max3D.

If you want to stay in business then you have to do unpopular things from time to time. And I think we all want BRL to stay in business.


Sledge(Posted 2006) [#16]

If you want to stay in business then you have to do unpopular things from time to time.



What an odd thing to say. Business is about supplying demand, so you supply what is popular if you've got any brains. (Unless you're massive and have a virtual monopoly, of course, in which case you can do as you please.)

But hey ho, I'm sure Max3D will be very popular, so things really are as they should be. Personally though, it will have to be a phenomenal piece of work to get me to buy Max - a language which is crammed full of stuff I don't need and eerily bereft of things I do. So it's wrong to assume that improvements in B3D will necessarily harm Max sales - not everyone weighs the one against the other.


Scherererer(Posted 2006) [#17]
>>If you want to stay in business then you have to do >>unpopular things from time to time.
>
>What an odd thing to say.

I must disagree, it is in fact rather accurate. Sometimes you have to sacrifice to meet a deadline. Especially when it is one that was a while ago.


Stevie G(Posted 2006) [#18]
@jfk ... mucho respect but I've never heard so much p**sh !! Max could be 5-6 months away according to Mr Sibley, why not stick the defibulators on Blitz3d one last time!! There's life n the old dog yet I think!!

Sure, I'll move on eventually but for a beginner there is no better starting point!!

But hey ho, I'm sure Max3D will be very popular, so things really are as they should be. Personally though, it will have to be a phenomenal piece of work to get me to buy Max - a language with is crammed full of stuff I don't need and eerily bereft of things I do. So it's wrong to assume that improvements in B3D will necessarily harm Max sales - not everyone weighs the one against the other.


Agreed ;)


Ross C(Posted 2006) [#19]
Agreed too :o)


Vorderman(Posted 2006) [#20]
I'd love to add realtime shadows to SRX and see how it looks.

Max could be 5-6 months away according to Mr Sibley, why not stick the defibulators on Blitz3d one last time!! There's life n the old dog yet I think!!


Quite right - I own BMax as well as B3D, but there's no way I want to move all my game over to BMax just because it's newer. Also it lacks Tokamak support, so I'd have to completely re-do the game.

I'm sure I'd write SRX-2 in BMax, once the physics and 3d modules are completed, but why not add these features to B3D right now, it won't affect BMax in the slightest.


jfk EO-11110(Posted 2006) [#21]

Business is about supplying demand, so you supply what is popular if you've got any brains

well well - you are right, but are you willing to pay 100$ for blitz3d version 2.0? Because Mark added new powerfull features again and again, for free. Some of you seem to forget BRL needs to eat food as well, they are not machines.

Let us assume Mark would release Blitz3D 1.97 tomorrow, including all those things praised in this thread. Cool, people would add shadows to their Blitz3D engine, after about 6 months their new super uber hyper engine would be ready for release. Do you really think they will buy Max3D if they used to upgrade their game engines to "todays standards" based on Blitz3D ?

Even a converter app that will make 99% of blitz3D code Max3D compatible won't sell very well in that case. In the end all the Max3D work could be "for the cat".

Of course, a Blitz 2.0 Product for a reasonable price would be an option.

Don't misunderstand me. I'd love to have fast Stencil shadows in Blitz3D too, I could seriously add them to my engine. I only want to make clear that there are good reasons for in case blitz3D is declared a complete product, so you shouldn't be disapointed when there is no response. You have to see it positive: with Max3D you'll have all the power you wanted, for little money that will take you way less time to earn than to write only a fraction of something like Max3D.

But what I say is in no way representative for BRL, so maybe I'm wrong. I'm only guessing.


puki(Posted 2006) [#22]
This all seems quite exciting.

I'll still buy Cobra though as methinks that BRL will do a bit more on B3D when Cobra Larges - then again, DBPro does stuff Blitz3D doesn't and it has been ages.

Mmm.


Vorderman(Posted 2006) [#23]
Do you really think they will buy Max3D if they used to upgrade their game engines to "todays standards" based on Blitz3D ?


I don't think just adding z-buffer access support would bring B3D up to today's standards, but it would let us do lots more cool stuff.


jfk EO-11110(Posted 2006) [#24]
Well in fact I was asking for Z-buffer access too some time ago. In fact with physics, good shadows and good Blitz3D code you can do a lot. Of course, Max3D will feature much more cool stuff, like the whole shaders chapter and it will be much closer to "todays standards".

Puki
DBPro does stuff Blitz3D doesn't and it has been ages.


You must be talking about those crashes and bluescreens, right? (j/k, lee)


Tom(Posted 2006) [#25]
I think it's more of a priority issue with BRL.

Just 10 minutes!! please! :)


smilertoo(Posted 2006) [#26]
wouldnt it be simple just to add a 2nd version of the command that did what you wanted? leave the original command as is for those that dont need the access you want.


jfk EO-11110(Posted 2006) [#27]
Well Tom already suggested to make it an optional parameter, that would not affect the existing command.


Tom(Posted 2006) [#28]
Maybe he meant from Marks point of view?

copy RenderWorld() to RenderWorld2()

Rem out any lines with the following consts in them:
D3DRENDERSTATE_ZENABLE
D3DRENDERSTATE_ZWRITEENABLE
D3DRENDERSTATE_ALPHABLENDENABLE

and these for good measure:
D3DRENDERSTATE_SRCBLEND
D3DRENDERSTATE_DESTBLEND

compile...

email to Tom for testing *cough* :)

Take what, all of 5 minutes?


Stevie G(Posted 2006) [#29]
If it's really as easy as you suggest Tom ( and it seems that way ) then I'm really surprised no-one from BRL has responded to this. C'mon guys .. yay or nay? Help him help you :)

Stevie


Dreamora(Posted 2006) [#30]
On the DXTC: works without problems on my mobile radeon 9700 mobile :-) (at least on the latest DXTC - R2T DLL I found here on the boards)


Panno(Posted 2006) [#31]
give it a chance Mr.Sibly


Scherererer(Posted 2006) [#32]
Did anyone try e-mailing BRL? They might be too buisy drooling at E3's Wii to bother looking at the form. God knows I am :P


Sir Gak(Posted 2006) [#33]
puki: Liked your links in your sig about Fantasy RPG media. Thanks!


Beaker(Posted 2006) [#34]
This would be great.


smilertoo(Posted 2006) [#35]
Silence, brl hate you all.


Sir Gak(Posted 2006) [#36]
I emailed BRL to ask if Mark could make, for Blitz3D, a 2D Image command that would implement true alpha, ie, we have DrawImage and DrawBlock, but they don't use alpha, so how about a 2D DrawAlpha command for B3D?


Stevie G(Posted 2006) [#37]
Sir Gak, no offence but you can do this already using 2d in 3d engines ..... if a simple request such as Toms is ignored then onto plumbs you are young padwan! ;)

Stevie


elias_t(Posted 2006) [#38]
This has my vote too!

I bought b3d and b+.
What kept me from buying bmax was my frustration by the way b3d was abandoned.


Mustang(Posted 2006) [#39]
BRL silence is continuing... not surprising, really. Would have been great addition though. Blitz3D seems to be totally forgotten these days, probably feature-dead too for the developers... that's fine (sort of) but why keep us hanging instead of telling how it is?

And forget about me ever buying BMax - the same will happen to it too, sooner or later... and probably sooner than it's full potential is ever used. But hey, they will be always ÜberBlitz that's so much better than BlizMax could ever have been.


DareDevil(Posted 2006) [#40]
Mark & Skid they do not answer to the appeal?


Tom(Posted 2006) [#41]
Skid popped onto Irc a few nights back, I managed to speak to him about this and he has read my posts & emails.

I gather he does have a big workload, but I think he's made some kind of start, by that I mean he's going to look at bringing B3D source into the latest visual studio that BRL are now using, then hopefully he'll get a chance to see if my request can be done.

<trying hard to get Skids attention "right Skid"?> :P

heh
cya!
Tom


t3K|Mac(Posted 2006) [#42]
whew, at least they are alive ;)


DareDevil(Posted 2006) [#43]
The miracols (Queen) :)