Need help with 3D technique.

Everything related to 3D programming
mrw
User
User
Posts: 76
Joined: Wed Dec 31, 2014 1:01 pm

Re: Need help with 3D technique.

Post by mrw »

Nice with the ground texture. Really helps showing what you can see or not through the textures and shadow.

And this is getting weird. With #PB_Shadow_TextureModulative, All transparencies are there except for when the vertical worldmap shows its outside to the camera. Then the Geebee doesn´t show through, but the ground, bg and horizontal side shows through correctly.
If I change to #PB_Shadow_TextureAdditive the Geebee is correct, but now the ground texture never shows through any of the worldmap sides.
I hope this is the same you see? Very annoying if the same settings differ this much on different machines, since how can we trust it to be ok?
I will try this code on another machine I have, just to see if there´s any difference.

Can this has something to do with the cullingsettings?
The Geebee face might turn out better if you create 4 more points and polygons that shows to the opposite side? I also notice that you set the normals with NormalMesh(). I have had trouble with that so I have started settings them manually for each point.


Would be great if there were some nice tool where you could test all these OGRE settings since there is an extremely amount of trial and error and hopes of getting it right. Now my current project hasn´t come that far yet, but I can imagine when I add more stuff I will spend 90% of the time fiddling with the materialsettings.. ;)
applePi
Addict
Addict
Posts: 1404
Joined: Sun Jun 25, 2006 7:28 pm

Re: Need help with 3D technique.

Post by applePi »

no i can see the geebee2 from outside the box and through the 2 semi transparent sides.
look:
https://s17.postimg.org/o9j3s6owf/alpha.png

i think it is from your graphics card, because i have tried the same code in my other older computer with a card from ATI Radeon HD 5400 series, and i can't see the geebee2 from outside and through the semi transparent faces.

my current card which works is nvidea geforce GT 640 for the desktops
https://www.asus.com/Graphics-Cards/GT640DCSL2GD3/

many games developers states for the requirements to run their games a card at least xxx or above. on the other hand the cards makers say their card support opengl Z.xx but in reality their hardware lack many of the opengl features. from years of buying nvidia cards and other makers i trust their cards.
mrw
User
User
Posts: 76
Joined: Wed Dec 31, 2014 1:01 pm

Re: Need help with 3D technique.

Post by mrw »

There´s some weird things going on with my computer. I can get the same as in your picture "sometimes"!? Mostly not. It can differ between compiles even if I don´t alter anything.
So you are probably correct that my gfx-cards are not fully compatible.
I´m using a laptop that has two gfx-cards.
- Intel HD Graphics 4600
- Nvidia GeForce GT 730M
And I can choose which of these that your program will run with, and between these two there´s no visual difference. Or perhaps it is. I updated the Nvidia-driver first and the GT 730M is still supported.
Maybe this gfx-card selection is not quite correct, or it takes some time after I apply it. I obviously shouldn´t do these tests on a laptop...
And I know that the laptop-versions are not as feature-full as the desktop-versions.

I will test these on a desktop with a Nvidia GeForce GTX690 card later today and see if I get some other results there.

Worth noting perhaps is I run Win10x64 and PB is latest 64-bit.
mrw
User
User
Posts: 76
Joined: Wed Dec 31, 2014 1:01 pm

Re: Need help with 3D technique.

Post by mrw »

Ok, I have now tried your latest example on my other machine and still get two different results randomly.
I only use the setting "WorldShadows(#PB_Shadow_TextureModulative, 0, RGB(127, 127, 127), 4096)".
Seems to work as it should directly after I start PB and after a while, the error(can´t see Geebee texture through the worldmapside) starts.
Then the error does not go away until I restart PB. Then it works fine again for some time.

This must be some kind of bug.

Well, I think I will leave it as it it and go back to my project and add the side I want as transparent, as a submesh with its own material. Hopefully that will solve my original problem.


Thanks for your help!
mrw
User
User
Posts: 76
Joined: Wed Dec 31, 2014 1:01 pm

Re: Need help with 3D technique.

Post by mrw »

Ok, now I´m back to my original problem. Which was, how to create shadows in my box without showing the side that´s creating the shadows.
And as BinoX said, set the texture to 100% transparency which will create shadows.

I have tried many different ways of doing this but I can´t manage it.
I change my code to do the main box as mesh 0, so it can have it´s own material, and then I created this one side as a submesh.
I also skipped doing this in material-scripts so now its only in PB-code as Samuel and applePi did which seems much simpler.
Two different materials, using the same texture, enabling AlphaBlend on the submesh.

But the result is that the half transparent(the texture uses the alphachannel) side doesn´t cast any shadows at all.(Well, it does alter the shadows but I can´t really understand how). Unless I step inside of that side. Then I have correct shadows. And I need to see through it from a distance so this isn´t working.

The code that sets this is:

Code: Select all

texture_Box  = LoadTexture(#PB_Any, "Box.tga")
mat_Box = CreateMaterial(#PB_Any, TextureID(texture_Box))
MaterialFilteringMode(mat_Box,#PB_Material_None)

mat_BoxSide = CreateMaterial(#PB_Any, TextureID(texture_Box))
MaterialFilteringMode(mat_BoxSide,#PB_Material_None)
MaterialBlendingMode(mat_BoxSide, #PB_Material_AlphaBlend)

SetMeshMaterial(mesh_Box, MaterialID(mat_Box), 0)
SetMeshMaterial(mesh_Box, MaterialID(mat_BoxSide), 1)

entity_Box=CreateEntity(#PB_Any, MeshID(mesh_Box), #PB_Material_None)
I have the feeling this is fixed by some parameter but I can´t find it. Any ideas?
Post Reply