Author Topic: Transparent Crystals  (Read 1946 times)

Kanorie Lyanuw

  • Traveller
  • *
  • Posts: 16
  • Nora's eyes sparkle "Shinies…"
    • View Profile
Transparent Crystals
« on: October 14, 2011, 01:03:24 pm »
When will we have those? Maybe I saw some posts by LigH about them, or who knows. Is it about shadres or textures? Please, answer!

Nora's hologram: Help me, LigH-Wan Kenobi. You're my only hope.


Quote
Kanorie: I think Hangatyr's beard is sexy.
Bead: Hangatyr epitomises sexy.

LigH

  • Forum Legend
  • *
  • Posts: 7096
    • View Profile
Re: Transparent Crystals
« Reply #1 on: October 14, 2011, 04:17:42 pm »
:D

Yes, I already asked once ... PS#4914 - used "translucent" here as they should be "partially transparent".

"Refracting" would even be more challenging, for shader programmers ...

Gag Harmond
Knight and Ambassador
The Royal House of Purrty

Soloyos

  • Hydlaa Citizen
  • *
  • Posts: 284
  • Guardian-Bloodstone Brethren&Partner-Hydlaa Museum
    • View Profile
    • Bloodstone Brethren
Re: Transparent Crystals
« Reply #2 on: October 14, 2011, 06:39:43 pm »
The "Staff of Ways" or what ever its name is is translucent, take a look at the one in the museum if you cant find someone to show you one.


LigH

  • Forum Legend
  • *
  • Posts: 7096
    • View Profile
Re: Transparent Crystals
« Reply #3 on: October 15, 2011, 06:18:32 am »
Making a texture translucent is not the hardest task; but it may look weird afterwards because the 3D engine may not be prepared to render it correctly: There may be cases where the transparency visually cuts holes into other objects behind the crystal. The 3D engine would have to know that crystals are partially transparent, and therefore has to defer their rendering until after all other opaque objects got rendered. That's not trivial at all. And after all, probably impossible to make it correct in all cases.

Nevertheless, I may try to start testing with translucent textures, even without waiting for the correct rendering order...
__

P.S.: As expected - an Emerald in a shelf ... a random disadvantageous rendering order makes the floor behind the shelf appear through. But if you can live with this flaw, I could commit these textures for testing.

« Last Edit: October 15, 2011, 07:19:06 am by LigH »

Gag Harmond
Knight and Ambassador
The Royal House of Purrty

MishkaL1138

  • Veteran
  • *
  • Posts: 1175
  • Meh.
    • View Profile
Re: Transparent Crystals
« Reply #4 on: October 15, 2011, 02:31:56 pm »
And how about making crystals in different shapes? Just so they look like real diamonds, rubies and emeralds, smaller, not the biga$$ pointy rocks we have now. Someone could try their hand at it. Maybe I could try, I don't know.

"It's all fun and games until someone stabs someone else in the eye."

LigH

  • Forum Legend
  • *
  • Posts: 7096
    • View Profile
Re: Transparent Crystals
« Reply #5 on: October 15, 2011, 02:57:18 pm »
"Gem cutting" is not yet implemented - but will probably be part of another crafting rules set. After leatherworking, alchemy, etc.

So, well, making crystals translucent works in general, but there is only a really small chance that the render order is correct for all three types in the same sector. Usually at least one of them will appear "hyper-transparent", up to showing the "sky spheroid" below the town.

Gag Harmond
Knight and Ambassador
The Royal House of Purrty

Aramara Meibi

  • Veteran
  • *
  • Posts: 1062
    • View Profile
Re: Transparent Crystals
« Reply #6 on: October 15, 2011, 04:21:05 pm »
that effect looks very similar to the transparent hills all over bdRd2.
all blessings to the assembled devotees.

LigH

  • Forum Legend
  • *
  • Posts: 7096
    • View Profile
Re: Transparent Crystals
« Reply #7 on: October 15, 2011, 04:52:00 pm »
But it has a slightly different reason...

Here is a kind of "best case shot":



Who will spot the only flaw?  :detective:

Gag Harmond
Knight and Ambassador
The Royal House of Purrty

Aramara Meibi

  • Veteran
  • *
  • Posts: 1062
    • View Profile
Re: Transparent Crystals
« Reply #8 on: October 15, 2011, 05:52:36 pm »
the ONLY flaw? you mean other than they look more like ghost images than crystals? i think without reflectivity and refraction the more solid look is preferable. these just don't look solid to me.
all blessings to the assembled devotees.

LigH

  • Forum Legend
  • *
  • Posts: 7096
    • View Profile
Re: Transparent Crystals
« Reply #9 on: October 15, 2011, 08:55:39 pm »
Carps and crabs. :P

The more they are exposed to light sources, the more opaque they appear. So the shaders have a serious factor in their appearance.

Of course, writing a specific shader program for them would be the optimum. But are you able? Or do you know anyone who is?

And this was not the flaw I mean.

Gag Harmond
Knight and Ambassador
The Royal House of Purrty

Aramara Meibi

  • Veteran
  • *
  • Posts: 1062
    • View Profile
Re: Transparent Crystals
« Reply #10 on: October 15, 2011, 09:23:33 pm »
no sorry, i have less than zero programming skills. you're attempt is infinitely better than anything I could come up with, simply because i don't know the language of the medium.

what looks to be the problem is that the crystals are only being treated as their outer surfaces, rather than being treated as a solid mass. it also doesn't help that their surface map has the specular highlights drawn in (i'm noting the edges where two any two planes meet). To get the proper crystal look, they should be rendered first as solid, uniformly colored objects, with specularity, reflectivity, and most important refraction computed afterwards. I'm assuming this would require some sort of raytracing algorithm, and that was a class i just did not pay attention in (i was too busy rendering things with a pencil and paper).

thanks for your efforts, although clarity in crystals is in no way going to enhance my enjoyment of this game. I have no doubt, though, that you find amusement in playing with the system to produce desired results, and there is at least ONE player who does desire this effect, hence, this thread.
all blessings to the assembled devotees.

LigH

  • Forum Legend
  • *
  • Posts: 7096
    • View Profile
Re: Transparent Crystals
« Reply #11 on: October 15, 2011, 11:38:13 pm »
Realtime raytracing is probably not the part of the game which should take most of the development time. ;)

About the flaw: Look closer at the waysigns.

Gag Harmond
Knight and Ambassador
The Royal House of Purrty

Caraick

  • Veteran
  • *
  • Posts: 1145
  • I liked PS before it was cool.
    • View Profile
Re: Transparent Crystals
« Reply #12 on: October 16, 2011, 05:56:19 am »
Looks like the bottom of the wooden signpost's image is not visible when viewed through the crystal, to me.  An interesting little glitch..

Makes me wonder, if the whole of the signpost was viewed "through" these "crystals", whether or not it would simply be invisible to the viewer.  My assumption would be yes.
Hey look kids, it's the antichrist Marsuveus!
What? Doesn't he just look huggable? Aw, c'mon, give him a hug.


LigH

  • Forum Legend
  • *
  • Posts: 7096
    • View Profile
Re: Transparent Crystals
« Reply #13 on: October 16, 2011, 09:45:39 am »
You are right. As I already said in the beginning: There are some items which are rendered earlier than the crystal, and some items which are rendered later than the crystal. If the renderer uses the "Z buffer" (and it should, for efficiency), any object is treated as opaque, so every part behind the crystal rendering later than the crystal would be calculated as "being hidden behind the crystal in front, therefore rendering omitted to spare time". The only way to fix this is rendering partially transparent objects in an own specific render pass with tweaked options. But exceptions are usually less efficient (take more time).
« Last Edit: October 16, 2011, 09:48:47 am by LigH »

Gag Harmond
Knight and Ambassador
The Royal House of Purrty