Jump to content
The Dark Mod Forums

Renderer improvements


Recommended Posts

This weekend I was able to get blend shaders working in the DarkRadiant renderer, so that add or multiply material stages (such as might be used for water) now appear correctly.

 

Before

 

6xynmplnfzbvch3mh5o.jpg

 

After

 

atkjoaq4uwbba1vin902.jpg

 

The blend mode is now read from the MTR declaration, as well as the colour modification values (e.g. "red 0.8, green 0.7"), and these are used by the renderer. Colour modifiers only work for blend stages at this time, since I haven't modified the interaction fragment shader to handle vertex colours for diffuse maps; once this is done we should be able to add support for model vertex colouring as well.

Link to comment
Share on other sites

  • Replies 66
  • Created
  • Last Reply

Top Posters In This Topic

Superb - I was happy reading all these SVN commit messages throughout the weekend. :)

 

Happy to produce them. :) It think it must be about 18 months since I have managed to spend an entire weekend working on DR and produce something useful at the end of it.

 

*crosses fingers that this might be the beginning of renderer overhauling*

 

I'd certainly hope that I could address some of the more simple issues; vertex colours are in sight now, sky boxes (static, not portal) are a distinct possibility, foglights are borderline, and shadows are known to be hard because of the refactoring and maths involved. If the only thing that doesn't work in the DR renderer is shadows, I'll be quite happy.

Link to comment
Share on other sites

Great work Orb. Another step for DR toward accurate previews for mappers. :)

 

We should talk to the guys I mentioned in this thread.

 

http://forums.thedarkmod.com/index.php?showtopic=9041

 

This was the email I received from the lead coder.

 

Hi,

 

ODRadiant is currently in its very early development stages, and since I'm the only programmer in our team at the moment and I have to work on many tools apart from the engine and game code, I'm affraid it will take a long while to finish. In any case, the plan is to port portions of code directly from the OverDose renderer into ODRadiant for the "render mode" stuff. I'm leaving all this for later since I'm currently rewritting parts of our renderer (mostly the shadowing system), but if you're interested in using parts, or all of it for Dark Radiant, then I could share the code with you. I'm still not sure how I will integrate this into ODRadiant, and I don't know how different Dark Radiant is compared to Q3Radiant (which is our base for ODRadiant), so I may not be in the position of giving you the best advise or help right now, but you can count on the code if you're interested.

 

Regarding our DDS compression utility, you can get the full source from our repository over at SourceForge: https://odblur.svn.sourceforge.net/svnroot/odblur

 

If the GPL license is ok for you, then you shouldn't have problems using it.

 

ODCompress does depend on a DDS compression library by ATI themselves, but it is included with our source and seems to work perfectly so far. Be aware that it has a few things that are specific to our project, but it shouldn't be too hard to modify to suit your needs (mainly file system stuff such as game directories and pack file extensions).

 

 

Nicolas Flekenstein

Lead Programmer, Team Blur

http://www.teamblurgames.com

Link to comment
Share on other sites

About the shadows, I was wondering: is it possible to go to an open source shadow-capable engine (e.g. Ogre or Cube or even Quake open source) and steal borrow methods?

 

Don't underestimate the amount of work involved in integrating foreign code into an existing codebase; using something like Ogre is an excellent choice if you are starting from scratch, but getting it to play nice with an extensive existing infrastructure would almost certainly be more difficult than just implementing the shadow code directly.

 

In case you are just talking about looking at the foreign implementations rather than trying to borrow code directly; this is a valid approach, but in this case, I pretty much already understand how stencil shadows are supposed to work, it's just that there are two major tasks involved in implementing them (plus an unspecified number of "unknown unknowns" and minor tasks):

 

  1. Stencil shadows require a rendering algorithm that processes each light individually and accumulates the results into a final image; the DarkRadiant renderer is not organised like this, and considerable refactoring is needed to change this.
  2. Code must be implemented to calculate shadow volumes by extruding an object's silhouette outwards from the light source; this is not particularly complex mathematically but is completely new code that has to be added, rather than just tweaking and modifying existing functions.

 

Possibly if/when all the other more minor renderer issues are addressed, it would be interesting to look at the refactoring in (1) and see if is possible to modify the existing renderer to use this structure without necessarily changing anything else; at this point it would be easier to investigate the possibility of a shadowing implementation.

Link to comment
Share on other sites

Yeah I mostly meant the "seeing how" of it; I've tried tiny integrations with my own stuff a time or two (really trivial stuff comparatively) and yes it seems harder than just starting from scratch.

 

This sounds promising:

In any case, the plan is to port portions of code directly from the OverDose renderer into ODRadiant for the "render mode" stuff. I'm leaving all this for later since I'm currently rewritting parts of our renderer (mostly the shadowing system), but if you're interested in using parts, or all of it for Dark Radiant, then I could share the code with you.
Link to comment
Share on other sites

This sounds promising:

 

Yes, if they are using stencil shadows then their silhouetting and shadow-volume calculation code may be useful to us, once the necessary DR infrastructure is in place to make use of it.

Link to comment
Share on other sites

Vertex colours

 

Initial support for vertex colours is in.

 

odvjnlef111ix0keeps.jpg

 

So far, only simple vertex colour modulation is available, you can multiply your diffuse layer by the vertex colours, but blending between two textures is not yet supported. For this I will need to implement multiple-pass interaction shading.

Link to comment
Share on other sites

I suspect it's just displaying vertex blending, not actually doing it...that would still have to be done in a modeling program (or I'll be shocked). As far as I know, none of our models use vertex blending at this time.

Link to comment
Share on other sites

I never thought that a simple screenshot could be so confusing :laugh:

 

What is implemented is support for the vertexColor and inverseVertexColor stage keywords in material definitions. These keywords allow a material stage to be multiplied by the vertex colours which are included in the model file (after being added by a modelling program, there is no vertex painting in DR).

 

These vertex colours have two purposes. Firstly, they can modulate and darken the texture on a model in particular places, such as to give the impression of dirt or rust. This is illustrated on the second model from the left in the skins tutorial:

 

http://forums.thedarkmod.com/index.php?s=&am...ost&p=52511

 

Secondly, by using two diffuse/bumpmap stages, once of which has vertexColor and the other inverseVertexColor, it is possible to blend between two textures on the same model by using full-black to full-white vertex colours. This latter function is not yet implemented in the DR renderer, since currently only a single diffuse/bump/specular triplet can be rendered on a model.

Link to comment
Share on other sites

Going off-topic I know but can texture tiling be used on models? And if so, can't a variety of non-solid, flat panel models be made using vertex blending that might be resized using the rotation hack and placed against walls like decals? And yes, I don't know what I'm talking about. :)

Link to comment
Share on other sites

Going off-topic I know but can texture tiling be used on models?

 

Yes.

 

And if so, can't a variety of non-solid, flat panel models be made using vertex blending that might be resized using the rotation hack and placed against walls like decals?

 

I don't see why not, but I'm not really sure what you are aiming for here.

Link to comment
Share on other sites

For an ase model you should look for these in the material list (just open it with a text editor).

 

*UVW_U_TILING 1.0000

*UVW_V_TILING 1.0000

 

change the values to change the texture tiling. I don't know how this would work for lwo models. Opening them in a text editor gives me only nonsense.

 

I think I understand what you mean, there might be a value for such flat wall panels. But they wouldn't be flexible and you can't change the vertex pattern in DR. Learning just a little Blender can give you much better results.

Link to comment
Share on other sites

I've been trying to think of something along the same lines (if I understand you correctly). Standard generic panels or columns or mounds or whatever other useful shapes, could have blending coords defined within them, and then we tweak the materials to change the blend constituents. Voila, simple blended building pieces. Depending on how easy it is to modify them, they could have generic position of the blends, or anything the user wants. It'd be great to ship with such a set of "digital legos".

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recent Status Updates

    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 4 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...