DD_MODEL 1.0 (DelphiDoom's Procedural Modeler)

DD_MODEL is a tool for creating procedular models for DelphiDoom.

Current version is 1.0.2.

 

Features:

  • Script Editor with syntax highlighing.
  • Fast compilation.
  • Build in 3d preview with frame animation.
  • Export to binary (compiled format) files (*.dmx)
  • Decompile binary models (future version hopefully will support decompile of MD2/MD3 etc model formats)
  • Decompile the model's script to C or Pascal source.

 

Downloads: https://sourceforge.net/projects/delphidoom-procedural-modeler/files/DD_MODEL_1.0.2/ (Windows executable and full source code).

 

Procedural Model is a new DelphiDoom's model format available for the OpenGL renderer (version 2.0.3.706 or higher).

  • The mesh is generated with script using opengl commands. The application uses PascalScript as it's scripting engine.
  • Every model can have a number of Frames. A frame can call other frames (i.e. you can use a frame as a submodel). Special care has been taken to avoid dead ends when recursively calling frames.
  • DelphiDoom can use the *.dmx files or compile the source code and render the model. An example can be downloaded here.

 

Example code (generates a spinning plane):

model model1;

procedure MakePlane;
begin
  glbegin(GL_QUADS);
    glTexCoord2f(0,1); glVertex3f(-0.5,-0.5, 0);
    glTexCoord2f(1,1); glVertex3f( 0.5,-0.5, 0);
    glTexCoord2f(1,0); glVertex3f( 0.5, 0.5, 0);
    glTexCoord2f(0,0); glVertex3f(-0.5, 0.5, 0);
  glEnd;
end;
  
var
  i: integer;
begin
  SetFrame(0); // Set current frame to #0
  MakePlane; // Draw something

// Spin it
  for i := 1 to 359 do 
  begin 
    SetFrame(i);  // Set current frame to "i"
    glMatrixMode(GL_MODELVIEW);
    glPushMatrix;
    glRotatef(i , 0.0, 1.0, 0.0);
    CallFrame(0); // Call frame #0
    glPopMatrix;
  end;
end.

 

Screenshots:

Screen3.png

 

Screen4.png

 

Screen2.png

 

Screen1.png

 

Example:

SSHOT_Doom_20171114_213812521.jpg

Share this post


Link to post

Looking at the glBegin()/glEnd() code in the example, doesn't this feature lock you in using the deprecated "immediate mode" for OpenGL? That would make it harder to eventually move to Vulkan.

1 person likes this

Share this post


Link to post
7 hours ago, Gez said:

Looking at the glBegin()/glEnd() code in the example, doesn't this feature lock you in using the deprecated "immediate mode" for OpenGL? That would make it harder to eventually move to Vulkan.

 

Thanks for your question, it gives me the opportunity to explain the method I've used.

The glBegin()/glEnd(), etc commands of the script are translated into an internal intermidiate structure that holds the appropriate mesh information. This is done when we execute the script. The script actual is generating the structure, it does not render the model. (i.e. script is not running while rendering).The actual rendering is performed by parsing the  structure and performing the appropriate drawing functions. Yes, the rendering is performed with the old deprecated functions in the editor, but there are no restrictions on what rendering techniques we will eventually use. We can render the structure using VBOs, D3D or even software rendering.   

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now