Saturday, February 1, 2020

Sony NEX-3 full spectrum modification.

Unfortunately, my old 450d that I modded last summer died when I tried replacing the sensor again. Looks like some sort of electronics issue, I may have shorted something during disassembly. It is possible to get replacement parts, but it might be cheaper to get a whole used camera. And I'm not sure what's the issue anyway - replacing the mainboard didn't fix the issue.
Luckily, I've gotten a well used NEX-3 camera last November for 50 EUR. It has been sitting in my desk for three months while the cheap lenses and adapters were making their way through the mail system from China. So I've only been able to test functionality last week, and after confirming that there are no issues decided to disassemble the camera to remove the IR filter.

Unlike the previous camera I worked with, there is no step-by step guide for this model. I've found a tear-down article that was somewhat helpful, however. NEX-3 is a mirrorless camera, so in contrast with the DSLRs it has everything cramped in a much smaller space. There are a lot of screws to remove, and to get to the sensor pretty much everything other than the mount and shutter has to be removed and disassembled.
The filter stack is glued on to the glass on top of the sensor, with only a thin rubber spacer in between. It is possible to remove it fully from the unit with the PCB and shield, so I heated it up with a hair dryer and used a thin metal pry tool to remove the stack, then wiped the remaining glue with a piece of fabric. I decided to keep the black frame that was on top of the filters as an additional dust barrier, but I had to secure it in place with a piece of insulation tape.

Easy to tear down, they said, convenient Sony layout, they said.
One of the thing I read about before I went through with the procedure is that mirrorless cameras don't need any adjustments of the shims, unlike the DSLR cameras, since their auto-focus method analyzes the actual image sharpness. I had to get expensive filter replacement glass for the 450d to keep the optical path roughly the same, and make custom shims as well.
Seems like it's not exactly true. I've found this thread about not being able to focus to infinity with manual lenses after filter removal. While automatic lenses might work, manual ones can have issues if distance to the sensor is not adjusted, or a replacement glass not put in. So after removing the filters I thought hard whether to remove the shims as well, but decided to keep them. And, unsurprisingly, I ran into the same issue - when trying to focus into the distance with a manual lens, everything was still blurry.
So I disassembled the camera again, this time measuring the shims, which turned out to be 2x0.3mm and 1x0.34mm. I don't know why the article I linked at the beginning says that there are no shims in this model - maybe they had a different revision. I've removed the thinner shims entirely, and made a replacement 0.05mm shim for the remaining one out of a feeler gauge to keep the tilt. This time it became possible to focus properly, even if the marks on the lens show that it's actually somewhat past infinity. Whatever, it works.

Cheap manual C-mount CCTV Fujian lens mounted with C-NEX adapter.
I am yet to test it with auto-focusing lens, since I'm still waiting on an adapter to arrive. But what I got so far looks pretty nice. All the filters I used before still work. There is some noise in the photos, but that's to be expected with the filter stack removed. My old Canon had some nasty horizontal/vertical noise lines, but that might have been due to the shitty replacement sensor I used. In fact, the camera died when I put the old sensor back, so I don't know if that would have happened with the old one as well. With this Sony camera the noise is uniform, so I'm fine with it. In fact, I expected to see more of it since it's a near-decade old used device. No wonder they are considered the best sensor manufacturers in the world.

Overall, the disassembly process is harder than with a DSLR as I mentioned above, because of the cramped space inside. There is no guide online, so I wouldn't recommend this mod for first-timers. There are a lot of hinge connectors to break, flex cables to tear, small screws to misplace, and plenty of inconvenient design decisions. In order to put the camera back I had to disassemble the screen to allow the flex cable to move far enough to be attached to the mainboard while rotating the cover 180 degrees to get it back on the camera. Screen has to stay disassembled to put the back cover on as well. If you do attempt a mod like this, I would recommend sorting the screws by tear-down stage and taking a lot of photos during the process. I still have one screw left that I have no clue about where it's supposed to be in the camera.

Now I'm waiting for warmer season with more vegetation to arrive. I wish the adapter came in a few weeks earlier, before I went to the Alps to take some interesting mountain photos, but alas, postal services work in mysterious ways.

Wednesday, July 31, 2019

"Full spectrum" camera modification.

Recently I have become interested in infrared photography. Got myself a screw-on filter set, dug out my old tripod, made some photos, some of them turned out pretty cool. But pretty soon I got tired of having to drag my tripod with me, since in most cases I need a 1+ minute long exposure with a standard camera (Canon 200D in my case). Tripod bumped, someone walks in front of it - get ready to set it all again. Forget about taking photos of moving objects, so anything other than still life is out of the question. And the whole procedure is tedious - since IR pass-through filters cut most of the visible spectrum, there is no auto-focus and you can't use the viewfinder. Camera must be focused first, only then filter is screwed on. Live view can be used instead, but it's not reliable, and some cameras don't have it.

So IR photography enthusiasts generally recommend modifying the camera by removing the internal IR/UV cut filters, thus significantly decreasing exposure times. Commonly referred to as "full spectrum mod", although the result is actually just "extended spectrum" - camera sensors have some sensitivity to near UV and IR ranges.
Sounds daunting, but the procedure is actually fairly straightforward. There are various guides online - especially for the purpose of astro-photography. They often have a need to increase the range of camera sensitivity and apply various exotic filters to get photos of celestial objects. Since I got a new camera, I decided to modify my 10 year-old Canon 450d, which, apparently, is one of the most popular cameras for this sort of procedure because it is really cheap by this point. I followed the guide by Gary Honis, which is really detailed - all you need is to be careful when following it since insides of the camera are quite delicate. And look out for dust. I swear, exposed sensor like a dust magnet.

After doing some research, I decided to get Astronomik MC Clear glass to replace internal filters. Yes, it's expensive. But it has a transmission curve that allows both UV, visible and IR, it is cut to replace native UV/sensor cleaner precisely, and has anti-reflective coating. The only other alternative I could find is a glass piece from Aliexpress, which, according to the sales rep is Chinese K9 glass. So it cuts UV, most definitely doesn't have AR coating, and costs nearly 32 EUR plus shipping. Might as well get Astronomik piece. I've also researched high-transmission glass to cut it myself but couldn't find anything that is sold not in industrial sizes. So in the end I shelled out about 50 EUR for the expensive option.
But if you don't care about UV, you can definitely cut your own glass from a screw-on UV lens filter or something like that. It generally transmits IR just fine. Having no glass is also an option, but auto-focus will not work on a DSLR, and your sensor is exposed to all dust and dirt that gets inside the camera when the lenses are changed. Auto-focus on mirrorless cameras will also work just fine without a filter or clear glass since they use image sharpness to see if an object is in focus.

I also decided that I might as well replace the old sensor unit entirely and ordered a replacement on Ali for about 17 EUR. I'm pretty sure it was a defective unit that was either pulled from a camera or after factory QC. There was some dust behind the built-in filters that was clearly visible on photos after replacement. Good thing I replaced the filters anyway and had a chance to clear it out. Additionally, I can definitely see some horizontal brighter pixel lines in dark spots on the pictures. But I can't rule out that it's just due to increased sensitivity after modification procedure and wouldn't have happened to the original sensor.

Now, the trickiest part part of the modification is replacing internal shims. Sensor needs to be at a certain distance away from the lens for auto-focus feature to work. Some cameras have adjustable screws with a spring, so it's easy. Most DSLR cameras have these little metal bits called shims that are placed between the sensor and the housing to adjust the distance. They are not just metal circles, but have a fairly complicated shape and are fractions of a millimeter thick. Old and replacement filters need to be measured exactly using a multi-meter and a special formula is used to calculate the thickness of the replacement. And no, it's not possible to just order these things online, at least as far as I know.
The guide I linked above actually contains a page about re-shimming procedure, but frankly, it just doesn't provide any info on how to actually manufacture the replacements yourself, so it's not very useful. It tells you how to calculate replacement thickness (which in my case was 2x0.25mm and 1x0.3mm), and that the best bet is to get a feeler gauge set, that is allegedly commonly sold in car shops. Which might be true in the US, but absolutely isn't in my case, where I visited several places over a number of days until I got referred to a specialty tool shop that had them in store. Previously, since I wasn't sure what I was getting, a large home improvement store sold me screw pitch gauge instead, and I felt really stupid afterwards. Honestly, probably easier to order these things online. Also, calculate your new shim thickness beforehand and make sure the set you are buying has necessary parts.
In any case, there is also little to no info about cutting new shims out of these little metal sheets online in general. I improvised:

- Place an original shim on top of the feeler and while holding it in place trace it with a permanent marker. This will get you a visual indicator of where to cut.
- File or cut the metal using available tools. I have a dremel tool, and it was incredibly useful for this purpose. But I suppose you could use a handheld metal file, it would just take a really long time.
I used a small cutting disc (like one of those for angle grinders, but tiny) to gradually eat away at the metal, as well as small metal pointy abrasive bits to drill holes. I tried a screw gun for drilling, but it is really hard to keep in place. Maybe a hand-held drill can do a better job but I don't have one. Also, I would recommend to drill holes while the new shim is still attached the rest of the feeler - this way it's easier to hold it in place.
Obviously, a dremel is a power tool that can and will damage you or surrounding items and furniture if you don't know how to use it. So if your arms don't grow from the right place, you don't have any experience with this tool, and you like your fingers still attached to your hand - opt for old-school tools.
- After cutting the new shim free and trimming all the edges make sure to sand it with fine sandpaper. Cutting/filing process will bend the metal around the edges, increasing overall thickness - I checked with the micrometer. So sanding will get rid of unevenness and restore the desired dimensions.

To be honest, I was surprised with how well they turned out. Manufacturing the replacements took about half an hour and they fit in the sensor assembly perfectly. Wasn't particularly hard either.

Now, the screw-ups. I definitely screwed a few things up. Overall, I de- and re-assembled the camera three times. First time to replace the sensor to test if it works at all. Second time when replacement glass arrived to remove internal filters and install the new one. During that time one of the hinges on the ribbon cable socket snapped in half, but luckily it was still strong enough to hold the cable. Assembled the camera and it would not read the memory card. I decided to disassemble the camera the third time to re-seat all ribbon cables, but as it turned out the tiny screws are not designed to be fiddled with so many times, and the top on one of them got stripped. Ended up filing the head of the screw with an abrasive dremel bit to pry away the back cover. Additionally, a couple screw holes had plastic thread that got stripped as well. So now some of camera outer body parts are only partially attached. Everything worked fine after re-seating the cables so I was really relieved.
And apparently the camera revision that the guide author used had a slightly different screw length configuration, because I definitely reassembled everything as was stated in it, but the last few screws were wrong length. Oh well, they still do the job.

So the camera works really well after the mod despite all the abuse I put it through. One thing I found out after the fact is that there are still some caveats about auto-focus. When using IR filter, the view-finder still can't be used, since it lets very little visible light through. So live-view is used instead. And turns out that since 450D is an older model, live-view is entirely separate from multiple-point fast auto-focus. AF only works after enabling it (Menu -> Settings 3 -> Custom Functions -> 8 -> Live mode), and then the * button in top right works as the focus. But then it uses image center to focus, and it's really slow and not very smart. "Quick mode" setting can be used, but then the camera switches out of the live view for a couple seconds, and result is unreliable in my experience. All in all, a huge pain in the butt. Apparently newer Canons might not have this issue, but it depends on the model.

So, was it worth it? Yea, I guess. The process was fun and a bit off beaten path, I learned a lot in the process. My old camera got a second life. And now I can take pictures of people and other moving objects through a variety of filters to get interesting results. Even still life can be made to look very unusual with the right filters. But I will write about that some other time.

Using model offset to fix partial 3d prints.

I've been doing some 3d printing for cosplay in the past couple of years. And as every 3d printer owner knows, stuff happens and prints sometimes get screwed for unforeseen reasons. I mean, so many factors can cause a problem it's not even funny or annoying to me anymore, I just sigh and try again after re-checking everything.
One of the common issues, especially with long prints (I'm talking dozen of hours and more) is when the filament runs out and you don't manage to swap it in time, or there is a power failure, and print outright stops midway. I'm sure it has happened to most 3d printing hobbyists at least once. Normally you would just swear a lot and write the spent filament off, but there is actually a way to salvage the print. Provided that it's the sort of print that you have planned to sand/paint anyway. The idea is to print only the remaining bit and then stick two parts together.

- Take micrometer calipers and measure the height of the printed part. Try to be as precise as possible.
- Go back to your model slicer and lower your model below the print base by the height of the printed part. I use S3D, but I assume it will work in other slicers as well - it should only slice the model above printing surface. So when you print it, you will end up only with a part that wasn't printed.
- Print the remaining part, and the glue the unfinished and new parts together. Since, in my experience, most plastic prints will deform slightly, you will likely need to fill the gap and sand it to get smooth surface. I prefer acrylic wood filler since it dries fast into a relatively hard and somewhat elastic substance, but still easy to sand. Then paint the model to get uniform color.

The same method can be used to print complex shapes without using supports. Most of my prints are going to be sanded and painted anyway, so I don't see this as extra work, and it saves filament. You can decide on the vertical offset, slice one part, then flip the model over and slice the other half.

I read about this trick on some facebook troubleshooting group, but fb is terrible for looking up information, so I'm putting this in a more static form. Hopefully it's going to be useful for someone.

Sunday, February 22, 2015

An update

I guess I could give a small update on what I'm doing with my life now. The last post was almost a year ago, after all.
Well, probably the most important thing is the fact, that I was hired by Keen SWH back in autumn. They were, and still are expanding in order to accommodate development of two games at the same time. The old one - Space Engineers, and a new one - Medieval Engineers, that went into early access on Steam a couple of days ago.
At the time when I joined, the whole art department of the studio consisted of two people, who had way too much work to chew through. Medieval was in a very unfinished state then, so I have been making new textures and editing existing models for it. Another guy who was hired along with me has been assigned the creation of collision and destruction models.
Other than that I had the pleasure to make weekly update videos for SE - recording footage, weeding out bugs, discussing functionality with programmers and testers. Before the announcement of ME I had to edit some of the videos for it, as well as make promotional screenshots.
So, while my work consist mainly of making art assets for the games, since the studio is fairly small, I get to do other art-related stuff. Sometimes, even weirder things, like recording the voice over for the tutorial for ME.
Company has employees from various European states. Most are local or from Slovakia. However, everyone is expected to be able to speak at least a bit of English, so language barrier is not a problem.

Concerning general living in Prague, I could say that it's a very pleasant place. Fairly low cost of living, beautiful surroundings, and good public transportation system. My main problem currently is the fact that it's very problematic to get by without speaking Czech or Slovak. While places in tourist areas usually have English or Russian-speaking staff, but that's about it. I am lucky if I stumble upon someone who understands a couple of words in these languages anywhere else.
I guess it's not particularly fair from me to expect everyone here to be multi-lingual. I really need to attend some sort of language courses, because basic phrases in Czech can only get you so far. But it's problematic to find time and energy while working full-time.

So, yea, that's about it. Now I'll just wait until spring is here. I'm tired of this cold weather.

Wednesday, May 21, 2014

Trying out UE4.

So now that the Uni is over I have some time to test out some of the software that has come out in the past few months. Including UE4. Especially UE4.
They've changed a lot of stuff in the editor, but overall it is still Unreal we all know and love. Well, at least I do. So far it is very pleasant to work with. I've modelled some stuff and set up a simple scene. Did some sculpting in order to refresh my ZBrush skills as well.
Here's how it looks so far with just a plain flat material.

Can't wait to get to texturing all this stuff. Node-based material editor is the best thing that happened to game development since in-editor game previews.

Tuesday, May 6, 2014


Here's the last update on the FMP. The last week or so was quite busy since I was trying to finish all things and bring the level to completion. The old buildings looked too monotonous since there were only two sets, so I've spend a couple of days making a third one. It is deliberately more gray and blocky than the first two in order to be more versatile in reagards to placement opportunities. The fourth building in that old square still consists of parts of the other sets, but I've replaced the materials with different coloured ones. Some additional facade decorations have been made as well. Existing decorations have been improved by getting a baked-in ambient occlusion maps.
Now, having more building modules, I have assembled a slightly more believable background in the inaccesible areas. It doesn not look like the same building copied and pasted around anymore.

A lot of smaller assets have been created to fill the scene. I've added pallets of bricks and cement bags to the areas with scaffolding. They serve both as vision occluders and additional stuff to look at.
A small adition to the futuristic area is the cleaning robot. It didn't come out as good as I wanted it to be, but still is a nice little point of interest. I've also added some signs and an ad poster. The latter looked a bit out of place, so I decided to place it only in the places where it is not very visible.
In order to breathe some life into the scene, I've decided to add some movement. Now there are seagulls circling around in the sky. From technical point of view, they are just planes with a picture of a bird, animated to continuously move in circles. There's also an animated vane on the spire of the old building extrusion, but it is less noticeable.

Some more movement is added by the falling leaf particles next to the trees. I've based the system on the particle that comes together with Cryengine, tweaking the values and changing the used texture to mine.

Other important part of immersion is sound. I've used some sound files that come with the editor. I'm not getting a degree in sound engineering, so I hope this is fine? Anyway, I've added randomized seagull calls, water sound next to the pond, general ambient wind, as well as cloth fluttering sounds. At least the scene doesn't seem to be dead when you walk around it.
And probably the last thing is the camera setup and video output. The work with trackview is enjoyable, however apparently it is impossible to get the render output rght and without any issues straight away. Like most things with Cryengine, nothing is easy and straigtforward.

So, here are some final renders and the video, enjoy.


The project is far from ideal. I definitely have taken on more that I should have. I had to take many shortcuts in order to get so much stuff done, and this means that the quality is sacrificed. Optimization is nonexistant, and the debugger screams at me with many warnings of exceeded budget.
Ideally, materials have to be reworked altogether in order not to have several duplicates. I am so used to UDKs system where you assign materials to IDs of each model that the way it is done in Cryengine seems very inefficient now.
LODs don't exist in this project. I've originally made all individual meshes in such a way that most of them are sub 1000 triangles, and cutting out any would distort the shape too much. However, there are still around 10-20 meshes which could benefit from creating a lowew-poly version of them. I simply did not have time for that, and performance seemed okay.
And while I get decent FPS even now, I can see how I can nearly double that by spending two weeks on optimization.
In any case, I am sort of glad that I've decided to take on such a large project. First of all, the fact that I could alternate between modern and old assets allowed me to not get bored of doind the same thing for nearly four months. This also allowed me to use the full spectrum of techniques that I know - sculpting, image-based texturing, spline and poly modelling. I even had a chance to make some simple animations. At some point in my life I would like to spend a couple of years making my own game with a small team, so the lessons I have learned will definitely be increadibly useful when building something even bigger than this.
Planning was rather funny. I tried to schedule what kind of stuff to do quite early in the production, but most of the plans had to be rearranged as priorities shifted. I'll have to come up with something when planning my future environments to minimize the rescheduling.
Other than that, this was quite interesting. Yes, I had periods when i was just too tired and bored of this, but generally it was rather fun. A great excersice in modularity. However, the next thing I'll do will probably be something small but detailed.

In creation of this project the following resources were used:
Cry Dev forums
DMUGA facebook pages
3dmotive tutorials
Eat 3d tutorials
Polycount forums
Varisous tutorials on Youtube
Various small blogs and forums
Help from the coursemates and tutors

← Previous post

Friday, April 25, 2014

Almost there.

This is probably the last update before finish, since we only have 11 days before submission. So without further ado, let's get this blog up to date.
The past couple of weeks I've spent working on the futuristic area. Most of it was already modelled, but I've made a lot of small tweaks, as well as adding new stuff. Obviously, the texturing was the main issue. In real life modern minimalistic building can have a completely plain, white surface, and this will work pretty well in correct lighting. Games, however, are still far away from realistic realtime global illumination, so this kind of plain material will look absolutely flat. So I settled on a couple of variations of concrete.

A new addition to already existing abundance of curves is the abstract sculpture in the central plaza.
In order to break up the clean whiteness, I've decided to add a bunch of organic stuff - rocks, grass, waterlilies. If I'll have some time, I'll add fishes to the pond as well.

Distance buildings don't look exactly as I wanted them to be, but they look detailed enough to serve as a fairly neutral background. Thre are 5 or so models that I've rotated and scaled in order to create this composition.

I still want to place more decals to add some dirt, as well as make the areas look more unique than just a bunch of surfaces with tiling textures on them.

Some funny things have occured as well. I was experimenting with wheteher it is possible to make a dynamic puddle using the dafault water shader. Turns out it's not. But there is an increadibly interesting glitch that occurs if you try to apply a water volume material to a custom plane.

Applying a solid decal messed up the look of the bricks. I've solved the issue by cutting out the bricks, so it's slightly better. Limits usability though.

Another issue that I'm still experiencing and can't find how to solve is some weird shadow behaviour. Basically, as the player moves around shadows that are supposed to be solid spaz out and let some light through. There are some issues with sun shadow casting range, where it works fine in some areas abut not the others. So far no solutions that I've found online work, so I'm out of ideas.

I plan to spend the last week getting the old area in order, adding some stuff, changing the existing things. A lot of stuff still doesn't have collision yet, so there's that. Plenty of work to do, but it should be fine.

← Previous post Next Post