Jump to content
The Dark Mod Forums

mohij for Dark Radiant coding


New Horizon

Recommended Posts

  • Replies 69
  • Created
  • Last Reply

Top Posters In This Topic

I don't know whether OrbWeaver has noticed the above post - in case you're eager to start with a new task I could think of something, which is not too vital/complex but should still be fixed:

 

Currently, the entity count and the brush count are displayed in the status bar, patches are ignored. What we could use is a service class providing an arbitrary number of counters and exposes that functionality for the entire application via a GlobalCounter interface. It can be designed as a module, but that might be too much for starters and can be done later on as well without any problems.

 

OrbWeaver, would this a suitable task? It seems to be self-contained (the class itself, the connection to the various systems might be more involved in the second step) and it may be suitable and challenging enough to learn from. If yes, we could talk about the details and start iterating (the first version will certainly need tweaks, judging from my own beginnings. :)).

Link to comment
Share on other sites

I am not sure that having a GlobalCounter module would be all that useful, unless there are likely to be a large number of globally-visible counters required. If the only thing missing is the patch count, it would probably be best to implement this in the same way that the brushes and entities are counted (whatever this is, presumably there is some scenegraph traversal class that does it?).

 

Fixing the patch count is certainly useful, but if mohij wants something more challenging then the Map Expressions support is needed before the 1.0 release. This is currently implemented very simplistically (by me), when in fact this should really be implemented as a hierarchy of polymorphic objects implementing an IMapExpression interface.

Link to comment
Share on other sites

Well, as I don't have that much insight in what is needed or not, I'm not sure what would be better to do.

 

The object counter seems doable.

The Map Expressions support sounds complicated, but I could at least give it a try.

 

So tell me what you think.

Link to comment
Share on other sites

Map Expressions support is of course more important than the counter, that's for sure, so this would certainly be appreciated by the mappers. :) The counter class is definitely easier to handle, but not that crucial. Currently the counters are increased/decreased directly in the Brush constructor/destructor and the EntityCreators via a global, if I recall correctly.

 

Concerning MapExpressions: The first step would be to discuss the existing code design and the plans - OrbWeaver already laid the foundation for this support in the shaders module (plugins/shaders), so starting a new thread about this might be appropriate. Don't know if it made even more sense to give you access to the DarkRadiant Development forum as well, that's up to OrbWeaver and the other project leads to decide.

 

In case you haven't already found it, this is the reference for shader definitions: http://iddevnet.com/doom3/materials.php

 

Currently, only the simple shader expressions like diffusemap/bumpmap and such are supported.

Link to comment
Share on other sites

I took a look for into the shadersystem. If I understand correctly, the MapExpressions are simple modifications to textures, to enhance them on demand. And they are specified in the .mtr (Material) files. What I don't understand is, what Radiant has to do with it. It doesn't display them (does it?).

Link to comment
Share on other sites

What I don't understand is, what Radiant has to do with it. It doesn't display them (does it?).

 

That's exactly the problem, they should be parsed and displayed correctly. For example, if you have a map expression like

 

map heightmap(some/texture.tga)

 

this needs to actually be converted into a normal map by Radiant so that the texture displays as intended. Currently I think it is just ignored (or possibly used as-is, without any conversion).

Link to comment
Share on other sites

Yes, Doom 3 is referring to materials (or better called shaders), they form the interface between the image files (TGA, DDS) and the actual rendered surface textures - some sort of abstraction layer. The word "material" is perhaps a bit misleading as it isn't a "surface type" like wood or stone.

 

DarkRadiant needs to understand the shader expressions to be able to render the preview image correctly. At the moment, only a few basic ones are properly evaluated. Things like heightmap() or addnormals() (which can be used to combine two or more normalmaps into one) are ignored.

Link to comment
Share on other sites

The current interface should already be adapted to handle these cases, it's mostly the back-end that should be changed.

 

I guess we should start a thread in the development forum about this, so that we can discuss the current state of the current shader module and the things that should be implemented. Please, can an admin set mohij's account up so that he can see the DarkRadiant Development Forum?

 

I can give you an introduction of the current shaders module tomorrow, as I'm too tired for today. :)

Link to comment
Share on other sites

So a refactoring of the interface, to be based on Shaders and not Textures would be appropriate?That would in some way be related to the MapExpression refactor, I think.

 

No, materials and textures are different things. A Texture is a single image which is bound in OpenGL for display on the graphics card. A Material is a declaration in a text file which pulls together one or more images, for example

 

textures/darkmod/something
{
diffusemap textures/darkmod/something_d.tga
bumpmap textures/darkmod/something_local.tga
specularmap textures/darkmod/something_s.tga
}

 

This single material makes use of three individual textures, for the diffuse, normal and specular components of the shader. Where map expressions come in, is that the specified images do not have to be used as-is, but can be modified, e.g.

 

bumpmap heightmap(textures/darkmod/something_h.tga)

 

In this instance the "heightmap(...)" is a Map Expression, it means "Do not use textures/darkmod/something_h.tga as the normal map directly, but run it through the heightmap converter first".

 

It is this last part which is not currently supported by DarkRadiant -- images can be used as textures without conversion, but the conversions are not processed if they are found in the material declaration.

Link to comment
Share on other sites

This is an example of a slightly complicated shader definition:

textures/darkmod/stone/trim/border_2x1
{
stone
qer_editorimage	textures/darkmod/stone/trim/border_2x1_ed
{
	blend diffusemap
	map		 textures/darkmod/stone/floor/rough_009_d 
	scale		1,2
}
bumpmap			textures/darkmod/stone/trim/border_2x1_local
}

Instead of a standard diffusemap blah.tga stage it uses a special stage for the diffusemap with a scale factor of 1 in the x-direction and 2 in the y-direction. This causes the diffusemap to be squeezed by a factor of two before it gets loaded into openGL memory.

Link to comment
Share on other sites

Feel free to open a new thread for this. The other one would be ok as well, but I think the MapExpressions deserver their own.

 

And yes, welcome to the ant-hill. Quiet on the outside, busy within. :)

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

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 1 reply
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...