Realtime transparency for faked volumetrics

Hi,

I’ve been experimenting with realtime transparency (using GLSL, but Texture Face or multitexture works just as well) as a way to show pre-rendered volumetrics in realtime. This works very well with a really good framerate. However, there seems to be a directional dependence to the transparency. It’s probably better explained by the images… everything looks great from one direction, but viewed from behind things are not rendered correctly.

I’ve attached an example file, it only uses 1 texture to keep the file size down. Obviously this looks way more impressive using multiple images. I’m using Blender 2.49 but the effect is the same in 2.61.

Any thoughts would be hugely appreciated. I don’t keep up to date with Blender as much as I would like, so maybe there’s a better way to do this that I’ve missed.

Thanks !

Rhysy

Attachments



VolumeExample.blend (266 KB)

Does anyone have any ideas ? I’ve found that the materials are processed correctly from all directions if I use TexFace materials and start game mode, but that’s the only way it works. But it would be so much more useful if it worked in normal realtime mode…

trying to understand what your want here !

i
can see like 490 plane faces beside each other !

why do you need these faces like that it’s not a closed object !

sorry but i tried your file and i get only an orange open box

i see you made it with close to 1900 verts
ok but why so much verts for a box ?

how do i get like in first pic !

i assume here that this is seen from the 3D viewport

i see you have transp and you made it shadeless + no camera !
alpha =1 so tranps is not used !

what does the mist has to do with this ?

thanks

Thanks for looking !

The reason that there are so many planes is because each one has a different texture. This is the classic “dupliframes” method for faking volumetrics.
(ok, in this example, I’m only using one texture to save file size - in practise I have hundreds of planes that all have different materials and textures assigned to them)

how do i get like in first pic !

You need to be in textured mode and turn on GLSL materials. EDIT : You might also want to scale the object down, or increase the clipping size of the 3D view as the mesh is quite big.

i assume here that this is seen from the 3D viewport
Yup !

alpha =1 so tranps is not used !
Actually there is a texture assigned to the material which multiplies the alpha values, so transparency is used.

what does the mist has to do with this ?
Umm… nothing… I never touched the mist options at all ! :confused:

but you have already applied the dupliframe to make all these faces here !

sorry to ask but how does the alpha from mat affect the texture ?
texture has it’s own alpha value !

have to think some more about this set up !

happy 2.6

but you have already applied the dupliframe to make all these faces here !
Yes, but this makes no difference to the problem I’m seeing - it just means that instead of seeing some nice fluffy volumetric clouds, you see some weird-looking pillar structures. The difference in transparency effect that you see from looking from different angles is exactly the same.

sorry to ask but how does the alpha from mat affect the texture ?
texture has it’s own alpha value !
It’s the other way around - the texture is multiplying the alpha value of the material. Actually, although it’s a PNG file, this image doesn’t have its own true alpha values, those are just calculated based on the RGB values. So, because most of the image is black, most of the alpha of the material will be close to zero.

Hope this helps !

re read first post

your main goal is
as a way to show pre-rendered volumetrics in realtime.
meaning you want to see it in viewport not in the render

you have like and object with some internal texture and you want to see it transparent in viewport

like a volume material with some inside texture !

thanks

That’s exactly what I’m after. I’m assuming that the true volumetric materials of 2.6 can’t be shown in realtime…

well we did some work on volume mat last year with NRK

so did you see this thread cause we did many different type of volumetric mat

one thing here not certain how you make your texture work in viewport
i mean even if you use GLSL it wont show generated texture only UV texture
and i don’t see your text being UV here

or i’m wrong may be ?

thanks

I haven’t seen that thread, could you post a link ?

Actually, GLSL textures don’t need to be UV mapped to show up correctly in the viewport - at least for planes. Cubic and spherical mapping doesn’t work, but planes are fine. Hopefully you can get the same display from the example file that I’m getting.

I already tried using UV mapping, but unfortunately that still has the same effect as in this example - transparency looks great from one direction, but horrible from the opposite.

http://blenderartists.org/forum/showthread.php?t=166174&highlight=volume+render

but lost’s of pages and example you can ask NRK to have a look at your thread here
he might help

i tried again in texture mode and GLSL to see any proc texture on a plane
and sorry to say but cannot see it !
and don’t remember this is something yu can do with GLSL!
but i may be wrong !

mind you i don’t have a big vid card so may be i cannot do it !
i do remember seeing something a long time ago but not certain if this was with proc text or UV Text

so you want to see the inside of an object transp in the viewport

but does this object has some sort of proc textu inside too ?
like a volume mat with some volume texture inside ?

i mean you could make a smoke texture transp inside

do you have a pic showng a model like that apart of the first pic in your thread
it may give us a clue on how to do this in 2.6 !

i mean in 2.6 we can do that

thanks

may be i should test my vid card !

can you make a single plane with text using GLSL and show pic of viewport then upload sample file
i’d like to test it on my vid card and see if it can do it and if i get same results then you !

thanks

Thanks for the link, will give it a good read. This technique definitely works for me ! Here is a flyaround video showing how things look using different images on each plane (again this is realtime, not a render). It also shows the weird transparency problem I’m having.

Cheers for looking at the file. Does the texture show up in the texture settings panel ? Pretty sure I packed the data, so it should be there…

but does this object has some sort of proc textu inside too ?
like a volume mat with some volume texture inside ?

The example file contains only a single image texture - nothing else. I guess if you wanted to you could pre-render procedural textures for realtime display. Personally I’m using it to look at radio astronomy data. It could make my life quite a lot easier if it worked properly…

I’ve attached a single-plane example file. It won’t show the transparency problem (you need multiple planes to see that) but hopefully you’ll be able to see a single plane with transparency. I also attached an image of what you should see on loading the file. All you should need to do is turn on GLSL.

From my tests I’ve found that 2.49 and 2.61 handle this in exactly the same way, so if you’re not seeing it in either version then I guess it could be your graphics card… we’ll need a third party to test this.

Cheers,

Rhysy

Attachments

VolumeExample2.blend (188 KB)


well here is what i see in 2.49 or even in 2.6
and i’v reloaded the text file.

so i guess i don’t see what you see i must be blind !LOL

but dont’ remember that GLSL can show proc texture anyway !
anyone can confirm this

now one thing if you add several layer of transp mat i don’t think they will stay transp after a few layer
i mean with well over 400 of layers it cannot be transp anymore !
there is too many layers anyway

so my guess is that you will have to use volume or may be go with voxels!

let me see if i can get some help here


thanks

for voxels have a look here

making a skull with voxels

Matt Eb Voxel medical image



Noise constraint

USING IMAGE SLICE VOXELS
This is using the sim_physics branch in blender SVN, you may be able to find builds for your system on graphicall.org
%%%%%%%%%%%%
Skull voxel
http://blenderartists.org/forum/showthread.php?t=200218&p=1740167#post1740167
Script to convert MRI image to blender
http://brainblend.sourceforge.net/

i mean if you have many slices you could use the script to make one file with all sclices inside one file
then use voxel to get it in blender

but not certain if this can be seen in viewport !

hope you understand it !

happy 2.6

thanks

found another example for voxel

this one seems to show in viewport

voxel to verts


for volumetric voxel texture see these

http://blenderartists.org/forum/showthread.php?t=200218&p=1740167%post1740167
http://blenderartists.org/forum/showthread.php?t=200218&p=1740853%post1740853

thanks

#13, #14. Texture image is png and packed into .blend. To experiment, i saved image on hd and reapplyed. Blender does not export/save any alpha information . File consisted of just RGB channels in exported .png. Had to add some alpha channel in gimp. Then it works in GLSL preview.

@ RickyBlender: Where, well, 4000 file rgba channel pixel values at some coordinates are 0, there it’ll be transparent if you summ them up…

Ignore if too late… :wink:

Sorry, red from beginning. So there is no alpha in texture file VolumeExample2, ok. Thing with calculated alpha seem do not work. All i see is black-red image in GLSL textured mode. No transparency at all in 3dviewport. In Material preview i see reddish transparent cube which suggest that something works nevertheless.

well here is what i see in 2.49 or even in 2.6
and i’v reloaded the text file.
Hmm, that’s interesting. You did have GLSL enabled (from the game menu)… right ? Just checking ! If you don’t then you won’t see the textures…

Could someone else take a look at the .blend ? Maybe it’s a video card thing. Unfortunately I don’t have access to any other machines I can install Blender on.

EDIT :

#13, #14. Texture image is png and packed into .blend. To experiment, i saved image on hd and reapplyed. Blender does not export/save any alpha information . File consisted of just RGB channels in exported .png. Had to add some alpha channel in gimp. Then it works in GLSL preview.

Thanks for looking ! It shouldn’t be necessary to generate an alpha map though… mine works fine just from RGB values… hmm…

I will take a look at those links. Actually I already have other scripts that can import data as verticies/cubes that are visible in the viewport. But this method of using image planes is potentially MUCH more powerful, because it uses a lot less memory. And because it works in realtime, that makes it really useful… making nice renders is great, but you can’t do a lot with them.

don’t remember that GLSL alow to see proc texture in viewport !
you can see UV map images but not proc textures!

but may be i’m wrong

or your vid card has some bad settings

voxel image can be very powerfull and works now in 2.6 see the thread for voxel textures
this might be one way of doing it and seeing it in viewport !

i ask help may be NRK will help with this one!

by the way does your astro pic have alpha in them and are like independant files = like slices !
then it should be easy to do with voxels texture !

happy 2.6

something is wrong with your RBG pic
first RGB don’t have alpha but might can be calculated

now better use PNG with alpha channel
that works all the time

but if you use the voxel then follow thread on voxel textures

it should work if you have real slices in files

happy 2.6