CreatorsOk
vrengames
vrengames

patreon


Rendering Experimentation

All of the bugs that have poked their head up in v0.18.0 (so far) have been squashed, so I've been using my spare time tonight to do some experimentation. In particular I am looking into a different method for rendering out the images used for clothing and character bodies to see what extra image processing options it would give me.

First, a lightning quick primer on 3D graphics. When displaying a 3D object there are three main types of light that need to be considered: diffuse, specular, and ambient. Diffuse light is highly scattered, like the light that bounces off of a sheet of paper. It varies moderately with the angle of the light. Specular light is the highly directional light that comes from reflective surfaces. A polished plastic would have a large specular component, and this component is extremely dependent on the direction of the light relative to the camera. Finally, ambient light is a quick "cheat" that gives extra light to locations not exposed to any, often to represent the bouncing light in a scene that would be too computationally expensive to simulate. When these three components are put together you get a good looking 3D image. Different amounts of different components create the appearance of different materials.

Currently the images for LR2 are rendered in a single pass; the image produced already has all three components added together. This is convenient, but it takes away some of the potential for image manipulation later. I am experimenting with Daz rendering out each component as a separate image. I can then adjust the amount each component contributes to give the illusion of a different material or surface condition. Softer and rougher materials, like cotton, would have a smaller specular component. Smooth materials like latex would have a much larger specular component, as would wet materials. This approach would also let me remove a quirk of the existing colouring setup: specular highlights normally appear the colour of the light hitting the object, not the colour of the object itself. Right now the highlights are caught by the same colouring pass as the base clothing item, which produces an effect that doesn't look quite right.

The tests I'm doing are purely a proof of concept; there is no immediate plan to change over to this system of rendering. Doing so would require a significant restructuring of the file system and display system inside of the Renpy code. If my tests look good and I do not hit any roadblocks I may plan this upgrade into a future update! If they look good you can also expect another dev post in the future showing off some examples.

Comments

One neat trick you can do by seperating out the ambient layer: fake Global Illumination. Take the average of the background scene (or split it into sectors or quadrants around the sprite to get a few averages over smaller aeas) then tint the ambient layerbased on that average (or the multiple averages over different portions). You don't get real GI because it ignores model geometry entirely, but it means that the sprites look different for each scene, and will (for example) look darker (and generally bluer) in dark environments and brighter (often yellower) in bright environments.

Psuedonymous

If you end up rewriting anyway, do us a favor and pack all those tiny images into an aggregate datastructure on disk so we don't have to deal with all the inodes or the terrible windows performance managing such little files like when extracting / copying / etc.

ikiris

Sounds cool. Always enjoy the technical musings you do. So feel free to write out your thoughts on these subjects even more, they're always interesting.

Mr. L

*thumbs up* it's just a shame you went with Ren'py this time, not that you are not doing a great job, I can just feel the technological cockblock, and especially the lack of low-level memory optimisation in parts of the game :)

waffel


More Models and Creators