Jump to content

Porting NWN animations - a work in progress


Recommended Posts

4 hours ago, Sam. said:

The count starts at 0.

This is the programmer within you that says this. "The count" starts for me from the "first" color, not zero'th one, as we are not dealing with ones and zeros only, aka binary, but of decimal one. Yes, even though it might be flagged as zero in the binary data(I have no way to verify this). Which is why we use the ordinal form of the word "one" rather than the word itself. And if it's not obvious, there's no such a thing as "zeroth" in English, as it doesn't make sense. And yes, wikipedia is wrong. 😛

Link to comment
10 minutes ago, Jarno Mikkola said:
4 hours ago, Sam. said:

The count starts at 0.

This is the programmer within you that says this. "The count" starts for me from the "first" color, not zero'th one, as we are not dealing with ones and zeros only, aka binary, but of decimal one. Yes, even though it might be flagged as zero in the binary data(I have no way to verify this). Which is why we use the ordinal form of the word "one" rather than the word itself. And if it's not obvious, there's no such a thing as "zeroth" in English, as it doesn't make sense. And yes, wikipedia is wrong.

I say the count starts at 0 because the internal structure of the binary file format starts counting from 0.  This is an objective fact.  Please keep your verbal vomiting to yourself.

Link to comment

To be honest I don't think forcing a indexed palette is the issue here. You may use this addon to force any palette at render times. But I don't know any automated way to generate 254-color index from bunch of renders (this way you preserve most of the original colors) and insert two colors at the beginning for transparency and shadows. I still think some BAM converting tool is better candidate for such tasks.

Link to comment

Throw all images to a GIMP project, index the whole thing to 254 colors and reorder the palette. GIMP doesn't flatten the image during indexing.

Is there a tutorial how to export an NWN model and import into Blender? I'd like to experiment to see where would I get stuck with the DonutArnold C&C templates from PPMForums.

Edited by Graion Dilach
Link to comment

Totally forgot GIMP exists and is open source. I'll give it a go (although I fear it's going to be another step that adds hours to the overall process).

Exporting is extremely easy when you know how. All you need is NWNExplorer and all the models can be found in the NWN Main Data section under any models.bif folder. If you're having issues finding the specific model you want the appearance.2da file can tell you what it's named as. Importing it into Blender requires the Neverblender plugin, after which you can import .mdl files.

Link to comment

I think you are almost there. I just rendered the golem from your blender template file.

First, I disabled anti-aliasing by setting the filter size to "0"

602277013_rendersettings.thumb.jpg.b84c6d864bf6e737a8bddad6cd0b1aac.jpg

...then I adjusted the shadow color of the shadow catcher material to assign a unique, distinctive color:

2095802140_shadowcatchersettings.thumb.jpg.23f25a7c3d1572d34ad214650363e028.jpg

I do not have access to NWN files at the moment, so the rendered golem looks a little wonky without textures:

shadow_transparent_00.jpg.937ca9cbb2d4dcc92d85c509988da00d.jpg

I used BamWorkshop II for the conversion and assigned that "red" color as a shadow color:

shadow_transparent_01.jpg.730432dc824c54ad90395cc17032ace0.jpg

That way, you have a transparent shadow ingame:

shadow_transparent_02.jpg.b45309087506fe375ca20cc4be785d2c.jpg

As you can see there are still blurred green lines around the shadow. I guess you have to tinker around with the settings of the shadow catching material.

Using BamWorkshop II is very time-consuming, however, so I hope there is another tool that can handle shadow colors and create a 256-bit palette bam.

EDIT:

Here's the final result without blurred lines so far:

shadow05-02.jpg.a0eacd94fe607817a702711b49b80413.jpg

Edited by Acifer
Link to comment
6 hours ago, DreamSlaveOne said:

But I don't know any automated way to generate 254-color index from bunch of renders (this way you preserve most of the original colors) and insert two colors at the beginning for transparency and shadows. I still think some BAM converting tool is better candidate for such tasks.

5 hours ago, Acifer said:

Using BamWorkshop II is very time-consuming, however, so I hope there is another tool that can handle shadow colors and create a 256-bit palette bam.

PS BAM can do all this, or I could add the necessary functionality.  With hundreds or thousands of frames this large it wouldn't be particularly fast, but it would be automated so you could just let it run in the background.  A quick automated pre-pass with ImageMagick to clear up the fuzziness at the edges of the shadow and ensure the shadow colors are set properly, and you wouldn't have to do anything manually.  I'd be willing to do it, or help, or provide a detailed guide.

Link to comment

The edge problem on @Acifer's example is because the renders were antialiased against the background as well which you don't want.

https://blender.stackexchange.com/questions/84533/how-do-i-get-my-renders-to-not-antialias-with-the-background-cycles

In C&C, the standard is to render the object and the shadow separately then merge them in the asset (TS/RA2 has split shadow rendering though). It is more work but it doesn't have AA issues for sure and I'd say that you do want antialiasing within the object, just not on the edges.

Edited by Graion Dilach
Link to comment
2 hours ago, Graion Dilach said:

The edge problem on @Acifer's example is because the renders were antialiased against the background as well which you don't want.

Unfortunately I switched AA off by setting the filter size to 0. The creature model has sharp edges, but the soft edges of the shadow occur because the shadow filter uses a transparency fade; it gets more transparent at the edges. You can get rid of that that by adjusting the Color Ramp filter I guess.

2 hours ago, Graion Dilach said:

In C&C, the standard is to render the object and the shadow separately then merge them in the asset

Another reason: if you normally choose a unique shadow color, this colored shadow will also be cast on the object, causing ugly artifacts on the object. Since Artemius has managed to separate the coloring process of the object and the ground plane (which catches the shadow), there should be no need for further adjustment if everything is set up in Blender as it should be.

I should point out that I have little experience with Blender, but I did render dozens of NWN animations using 3DS Max a few years ago and am quite familiar with the issues and obstacles discussed in this thread. I'm totally impressed with how @Artemius I has put everything together so far.

My experience is that you should put all your efforts into creating a well-functioning rendering setup (Blender file) and try to use as few different editors (like GIMP) as possible, since you might have to re-render and re-import your animations quite often at the beginning.

EDIT:

@Sam.: That sounds like just the tool we need - great! It's good to know that there are good modding tools out there these days that make life easier.

Edited by Acifer
Link to comment

Okay, new process seems to work without issue. Shadows are transparent, the sprite is has much more defined colors and detail without transparent colors filling the palette, and I can even externalize a custom palette and apply it without any problems. The purple is just testing, it looks horrible but theoretically I could directly recolor off the GIMP image and export the palette. I'm still not sure I'd recommend actually using this method as is since it takes forever just for one sprite (granted, this is a relatively old machine and more up-to-date hardware might make a difference), but this is the closest to a perfect final result so far.

Baldr095.png.3f5f9863eeeac7d08a61b74a7b59467e.png

Edited by Artemius I
Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.

×
×
  • Create New...