Remember me
You are here: HomeForumCyberix3D ForumGeneral DiscussionHow do I copy and paste?
Welcome, Guest
Username: Password: Remember me

TOPIC: Fake shadowmaps

Fake shadowmaps 8 years 4 months ago #569

  • Ganderoleg
  • Ganderoleg's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 115
  • Thank you received: 12
I understand that there is no Second Skin Set feature for Shadowmaps in Cyberix3D but I was wondering if there is some trick or a loophole that could do the similar thing?

I was experimenting with models alpha channels but, after an hour, realized that if both models are placed at exactly the same position they both need to be transparent in order to have their textures visible :) ...so firstly I'm not too bright and secondly it's not going to work that way :lol:

www.gamemaker3d.com/player?pid=051530016887

I did notice that the Editor-Terrain have advanced UV-mapping so I had an idea to replace default terrain model but it seems that that's not possible.

Any idea on how / if shadowmapping can be achieved? Maybe with some sort of sub-model instance with different UV / Skin set?
Last Edit: 8 years 4 months ago by Ganderoleg.
The administrator has disabled public write access.

Fake shadowmaps 8 years 4 months ago #572

  • cyberix3d
  • cyberix3d's Avatar
  • OFFLINE
  • Administrator
  • Posts: 703
  • Thank you received: 697
This feature is currently not supported. Since this is a simple feature to implement we will add it soon.
We will let you know when it's done.
Regards,
Cyebrix3D team
The administrator has disabled public write access.
The following user(s) said Thank You: Ganderoleg

Fake shadowmaps 8 years 4 months ago #573

  • Ganderoleg
  • Ganderoleg's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 115
  • Thank you received: 12
Thanx, shadowmaps would be a great asset :) They are really good for making the environment seem more detailed and they can be very useful for mobile platforms since developer could disable real-time lighting without really damaging overall visuals :)
The administrator has disabled public write access.

Fake shadowmaps 8 years 4 months ago #575

  • cyberix3d
  • cyberix3d's Avatar
  • OFFLINE
  • Administrator
  • Posts: 703
  • Thank you received: 697
The Light Map is ready in the beta channel.
www.gamemaker3d.com/editor/beta.html

You can apply the Light Map through the material's Light Map property:
2016-08-20_19-12-54.jpg


Take in count that u,v of the model must represent u,v of the lightmap.

You can test it with this code:
<GameMaker3D original="0">
  <CameraController controllerType="firstPerson" flyMode="1"/>
  <Model autoCenter="0" fileName="ganderoleg/10_shdawd.awd" scaleY="1" scaleZ="1" scaleX="1" rotationY="270" texture="mwalls" x="0" y="0" z="0" name="walls"/>
  <Material name="mwalls" picture="rock.jpg" lightMap="ganderoleg/ani_10_shd.jpg"/>
</GameMaker3D>

Please tell us if it suits you needs.
Regards,
Cyberix3D team
The administrator has disabled public write access.
The following user(s) said Thank You: Ganderoleg

Fake shadowmaps 8 years 4 months ago #576

  • Ganderoleg
  • Ganderoleg's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 115
  • Thank you received: 12
Thank you, this is a great and very helpful feature :) :)

Unfortunately I can't test it on my models at this time because my UV's are wrapped (they are overlapping) and my lightmaps are using second (unwrapped) UV sets for each model :( I mostly use overlapping UV's so that I can make easier texture-replacements and have higher details with lower image sizes but I will test it as soon as I modify a room so that texture UV's and lightmap UV's are identical :)
The administrator has disabled public write access.

Fake shadowmaps 8 years 4 months ago #577

  • cyberix3d
  • cyberix3d's Avatar
  • OFFLINE
  • Administrator
  • Posts: 703
  • Thank you received: 697
We can use secondary UV for the lightmap if secondary UV present in your model.
We couldn't find the secondary UV in your AWD model.
The administrator has disabled public write access.
The following user(s) said Thank You: Ganderoleg

Fake shadowmaps 8 years 4 months ago #578

  • Ganderoleg
  • Ganderoleg's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 115
  • Thank you received: 12
Yes unfortunately, models that I'm using in my project are all made with 3D Game Studio, they are in MDL7 format that supports two UV sets. I'm not really familiar with AWD format, actually I heard of it for the first time when I started using Cyberix3D :blush:

If I understood it, AWD supports two UV sets?

If this is the case I can easily add second UV to existing AWD models as soon as I figure out the workflow :)

EDIT: All my models already have lightmaps on second UV's, I just exported only one (texture) UV from MDL7 to OBJ and then to AWD. If AWD supports second UV set I can also export second UV's from MDL7 through txt or other supported format.
Last Edit: 8 years 4 months ago by Ganderoleg.
The administrator has disabled public write access.

Fake shadowmaps 8 years 4 months ago #579

  • cyberix3d
  • cyberix3d's Avatar
  • OFFLINE
  • Administrator
  • Posts: 703
  • Thank you received: 697
Yes, you are right. AWD doesn't support secondary UVs.
Alternatively, We can import the secondary UVs from another model.
In that way, you will need to export 2 versions of the model : one with the regular texture UVs, and another with the lightmap UVs.
Do you think it will help you?
Last Edit: 8 years 4 months ago by cyberix3d.
The administrator has disabled public write access.
The following user(s) said Thank You: Ganderoleg

Fake shadowmaps 8 years 4 months ago #580

  • Ganderoleg
  • Ganderoleg's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 115
  • Thank you received: 12
That could work well also, I'm not sure about two things:

1. Should I have two identical models with different UV's loaded in the level and then select the second model-name as a lightmap reference?
2. ..or should I have a UV-map as a txt file (or some other format) and load it similar to animation or audio file?
The administrator has disabled public write access.

Fake shadowmaps 8 years 4 months ago #581

  • cyberix3d
  • cyberix3d's Avatar
  • OFFLINE
  • Administrator
  • Posts: 703
  • Thank you received: 697
1. Should I have two identical models with different UV's loaded in the level and then select the second model-name as a lightmap reference?
Yes, This would be easier for us to implement.
2. ..or should I have a UV-map as a txt file (or some other format) and load it similar to animation or audio file?
If the first option is too complicated, We can also implement this feature.
The administrator has disabled public write access.
The following user(s) said Thank You: Ganderoleg

Fake shadowmaps 8 years 4 months ago #582

  • Ganderoleg
  • Ganderoleg's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 115
  • Thank you received: 12
The first option would be as good as the second one and maybe even easier from the users point of view :) :)

I only thought of the second option because of the double-geometry issue but if the second model can be set to visible=0 then i guess overall game-speed will be unaffected :)
The administrator has disabled public write access.

Fake shadowmaps 8 years 4 months ago #583

  • cyberix3d
  • cyberix3d's Avatar
  • OFFLINE
  • Administrator
  • Posts: 703
  • Thank you received: 697
We will just let the user choose the model file for secondary UVs inside the Material as a Secondary UVs option. When the user clicks on it, the regular model picker will be shown.
That way the user won't need to add another model and set it's visibility to 0.
The administrator has disabled public write access.
The following user(s) said Thank You: Ganderoleg

Fake shadowmaps 8 years 4 months ago #584

  • Ganderoleg
  • Ganderoleg's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 115
  • Thank you received: 12
This is excellent solution, very user-friendly, thank you :woohoo:

I will re-export one room in parts with two UV's each in AWD for testing. If it works out as expected that would be epic :)
The administrator has disabled public write access.

Fake shadowmaps 8 years 4 months ago #585

  • cyberix3d
  • cyberix3d's Avatar
  • OFFLINE
  • Administrator
  • Posts: 703
  • Thank you received: 697
The Secondary UVs is ready in the beta channel (It's still experimental):
www.gamemaker3d.com/editor/beta.html

In order to use it, You first need to import the Secondary UVs for the model:
2016-08-21_07-45-26.jpg


Then You need to check the "Light Map Secondary UV":
2016-08-21_07-39-09.jpg


You can use this code as an example:
<GameMaker3D original="0">
  <CameraController controllerType="firstPerson" flyMode="1"/>
  <Model autoCenter="0" fileName="ganderoleg/10_shdawd.awd" secondaryUV="ganderoleg/10_shdawd.awd" scaleY="1" scaleZ="1" scaleX="1" rotationY="270" texture="mwalls" x="0" y="0" z="0" name="walls"/>
  <Material name="mwalls" picture="rock.jpg" lightMap="ganderoleg/ani_10_shd.jpg" lightMapSecondaryUV="1"/>
</GameMaker3D>

Regards,
Cyberix3D team
Last Edit: 8 years 4 months ago by cyberix3d.
The administrator has disabled public write access.
The following user(s) said Thank You: ViraX, Ganderoleg

Fake shadowmaps 8 years 4 months ago #586

  • Ganderoleg
  • Ganderoleg's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 115
  • Thank you received: 12
It seems I did something wrong or it's not working for some reason :(

This is the initial test setup where I have textured room on the left and lightmapped room on the right. Models parts are the same, they are extracted from the same mesh with both texUV and lightUV and then I just erased the second UV from each one.

www.gamemaker3d.com/player?pid=051530016934

..and this is the same test with added lightmaps to the model on the left (textured model). I can see UV's changing when I'm applying them but then nothing happens and, for some reason, the pillar-model-parts disappear :blink:

www.gamemaker3d.com/player?pid=051530016939

Also when I save and reopen the file it doesn't seem to be any difference, the left model seems normally textured (without the pillar-models) :(
The administrator has disabled public write access.

Fake shadowmaps 8 years 4 months ago #587

  • cyberix3d
  • cyberix3d's Avatar
  • OFFLINE
  • Administrator
  • Posts: 703
  • Thank you received: 697
It seems to be a problem with the first model only "06_zd_t.awd".

When we removed the "Light Map Secondary UV" from the material "mat_06_zd_t" it seems to work, but the lightmap looks strange. Maybe the UVs are not aligned right or we don't take it right.

Copy and paste this code in the beta channel:
www.gamemaker3d.com/editor/beta.html
<GameMaker3D original="0">
	<CameraController controllerType="firstPerson" collisionShape="Box" characterHeight="120" flyMode="1"/>
	<Group name="tex" visible="1" x="0" y="0" z="-809.13" isCollapse="0">
		<Model name="a06_zd_tex" fileName="ganderoleg/06_zd_t.awd" scaleX="1" scaleY="1" scaleZ="1" x="0" y="0" z="0" texture="mat_06_zd_t" autoCenter="0" secondaryUV="ganderoleg/06_zd_l.awd"/>
		<Model name="a06_br_tex" fileName="ganderoleg/06_br_t.awd" scaleX="1" scaleY="1" scaleZ="1" texture="mat_06_br_t" x="0" y="0" z="0" autoCenter="0" secondaryUV="ganderoleg/06_br_l.awd"/>
		<Model autoCenter="0" fileName="ganderoleg/06_po_t.awd" scaleX="1" scaleY="1" scaleZ="1" name="a06_po_tex" texture="mat_06_po_t" secondaryUV="ganderoleg/06_po_l.awd"/>
		<Model autoCenter="0" fileName="ganderoleg/06_re_t.awd" scaleX="1" scaleY="1" scaleZ="1" name="a06_re_tex" x="0.00" y="0.00" z="0.00" copyDir="Same Position" texture="mat_06_re_t" secondaryUV="ganderoleg/06_re_l.awd"/>
		<Model autoCenter="0" fileName="ganderoleg/06_sb_t.awd" scaleX="1" scaleY="1" scaleZ="1" name="a06_sb_tex" x="0.00" y="0.00" z="0.00" copyDir="Same Position" secondaryUV="ganderoleg/06_sb_l.awd" texture="mat_06_sb_t"/>
		<Model autoCenter="0" fileName="ganderoleg/06_sz_t.awd" scaleX="1" scaleY="1" scaleZ="1" name="a06_sz_tex" x="0.00" y="0.00" z="0.00" copyDir="Same Position" texture="mat_06_sz_t" secondaryUV="ganderoleg/06_sz_l.awd"/>
		<Model autoCenter="0" fileName="ganderoleg/06_zl_t.awd" scaleX="1" scaleY="1" scaleZ="1" name="a06_zl_tex" x="0.00" y="0.00" z="0.00" copyDir="Same Position" texture="mat_06_zl_t" secondaryUV="ganderoleg/06_zl_l.awd"/>
		<Model autoCenter="0" fileName="ganderoleg/06_kt_t.awd" scaleX="1" scaleY="1" scaleZ="1" name="a06_kt_tex" x="0.00" y="0.00" z="0.00" copyDir="Same Position" texture="mat_06_kt_t" secondaryUV="ganderoleg/06_kt_l.awd"/>
	</Group>
	<Material name="mat_06_zd_t" picture="ganderoleg/ani_06_zid.jpg" lightMap="ganderoleg/06_lm.jpg"/>
	<Material name="mat_06_br_t" picture="ganderoleg/ani_06_bronza.jpg" lightMap="ganderoleg/06_lm.jpg" lightMapSecondaryUV="1"/>
	<Material name="mat_06_po_t" picture="ganderoleg/ani_06_pod.jpg" lightMap="ganderoleg/06_lm.jpg" lightMapSecondaryUV="1"/>
	<Material name="mat_06_re_t" picture="ganderoleg/ani_06_resetka.jpg" lightMap="ganderoleg/06_lm.jpg" lightMapSecondaryUV="1"/>
	<Material name="mat_06_sb_t" picture="ganderoleg/ani_06_stub.jpg" lightMap="ganderoleg/06_lm.jpg" lightMapSecondaryUV="1"/>
	<Material name="mat_06_sz_t" picture="ganderoleg/ani_06_staza.jpg" lightMap="ganderoleg/06_lm.jpg" lightMapSecondaryUV="1"/>
	<Material name="mat_06_zl_t" picture="ganderoleg/ani_06_zlato.jpg" lightMap="ganderoleg/06_lm.jpg" lightMapSecondaryUV="1"/>
	<Material name="mat_06_kt_t" picture="ganderoleg/ani_06_kristal.jpg" lightMap="ganderoleg/06_lm.jpg" lightMapSecondaryUV="1"/>
	<Material name="mat_06_lightmap" picture="ganderoleg/06_lm.jpg"/>
	<SetCamera x="133.71" y="72.32" z="-884.82" rotationX="-0.90" rotationY="96.90" rotationZ="0.00"/>
</GameMaker3D>
Last Edit: 8 years 4 months ago by cyberix3d.
The administrator has disabled public write access.
The following user(s) said Thank You: Ganderoleg

Fake shadowmaps 8 years 4 months ago #588

  • Ganderoleg
  • Ganderoleg's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 115
  • Thank you received: 12
Yes it looks messy, only the floor model is displaying the texute/lightmap right. With other models it seems that even the normal textures are off in a weird way :blink:

Maybe I could try to 'texturize' the lightmapped model? Add textures to lightmapped room and not the opposite?

EDIT: Maybe the joint UV process is having trouble with overlapping (textures) and unwrapped (lightmap) UV's? :( He can display them normally when apart but messes them when joined?
Last Edit: 8 years 4 months ago by Ganderoleg.
The administrator has disabled public write access.

Fake shadowmaps 8 years 4 months ago #589

  • cyberix3d
  • cyberix3d's Avatar
  • OFFLINE
  • Administrator
  • Posts: 703
  • Thank you received: 697
We need to do some investigations on your example. We will keep you posted.
And another thing, There are two ways to apply the lightmap:
1) Multiple the texture with the lightmap texture
2) Add the lightmap texture to the texture
We are using option 1 right now. Tell us if you also need option 2.
Last Edit: 8 years 4 months ago by cyberix3d.
The administrator has disabled public write access.
The following user(s) said Thank You: Ganderoleg

Fake shadowmaps 8 years 4 months ago #590

  • Ganderoleg
  • Ganderoleg's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 115
  • Thank you received: 12
Thank you, I hope I'm not creating too much of a hassle :unsure:

I guess that the No.2 option would be a logical way to go since models in Cyberix3D are meant to be used with one texture, so one unwrapped texture for diffuse and the same texture for lights would seem logical.

Unfortunately my models are using classical (128/256/512) textures that are overlapping for diffuse and one unwrapped texture for lights :( I am not sure about percentages and how many indie developers are using one unwrapped texture for diffuse, but if you think that the majority is using the unwrapped textures then the No.2 would be better.

At this moment my models are compatible only with No.1 option but I could unwrap the textures and re-light them in Blender if things go in the other way :)
The administrator has disabled public write access.

Fake shadowmaps 8 years 4 months ago #591

  • cyberix3d
  • cyberix3d's Avatar
  • OFFLINE
  • Administrator
  • Posts: 703
  • Thank you received: 697
We think we found the problem.
It seems that the number of UVs in the model and number of UVs in the lightmap model are not the same.
We took the first model for example and compared the number of UVs (using Prefab3d v2)

2016-08-21_20-06-44.jpg


2016-08-21_20-07-31.jpg


Eventually, it turns out that AWD supports secondary UVs if you import it from a model that support secondary UVs.
You can try to import from a variety of model types using prefab3d v2 or use the 3DS Max AWD exporter:
github.com/awaytools/AwayExtensions-3dsmax/releases
You can also look at this GitHub brunch for other AWD exporter plugins:
github.com/awaytools

Regards,
Cyberix3D team
The administrator has disabled public write access.
The following user(s) said Thank You: Ganderoleg

Fake shadowmaps 8 years 4 months ago #592

  • Ganderoleg
  • Ganderoleg's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 115
  • Thank you received: 12
Yes, numbers are not the same, it seems that this was my fault, sorry :(

Support for secondary UVs in AWD is a very good news, so if imported model has two UV sets then the AWD exported model can have them also?

I have preFab installed on my PC but it's v1.504. I will install v2 from their website.

It looks like I will have to experiment a bit with import/export programs and options for AWD. As soon as I get things in order I will try again with lightmap feature and post my findings :)
The administrator has disabled public write access.

Fake shadowmaps 8 years 3 months ago #594

  • cyberix3d
  • cyberix3d's Avatar
  • OFFLINE
  • Administrator
  • Posts: 703
  • Thank you received: 697
Don't worry about those teething problems :) We want this to work as much as you do.
Support for secondary UVs in AWD is a very good news, so if imported model has two UV sets then the AWD exported model can have them also?
Yes, it should work if the original model has secondary UVs.
The administrator has disabled public write access.
The following user(s) said Thank You: Ganderoleg

Fake shadowmaps 8 years 3 months ago #595

  • Ganderoleg
  • Ganderoleg's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 115
  • Thank you received: 12
I think I will, unfortunately, pause the lightmap and second UV experiments for now. So far I've been running into walls, this is my process so far:

1. Away Builder error: I always get the error #3615 when trying to select LightMapDiffuseMethod from Shading / DiffuseMethod.

2. Away Builder & preFab3D import formats: They both lack FBX importer and I believe that only other format that they can import with two UV sets is DAE.

3. 3DS MAX: I can't install AWD extension, when trying to install x64 setup I get error because he sees my system as x32 (it's actually x64) and when I try x32 the installer claims that he can't find some 3DSMax system patch.

4. Game Studio MDL7: original model format have second UV set but can't export it in FBX format with two UV sets but only with one.

5. Blender AWD extension: GitHub points that extension is not in a working state right now.

6. PreFab3D: It has a SOUR format that, they say, supports second UV set but I haven't tried it so far.

7. Cyberix3D engine: I've created and imported one-unwrapped-texture model with 2048/2048 texture but the texture looks too much blurry. I could try to unwrap texture of each separate model-part but that would lead to about 10/12 textures per model with at least 1024/1024 texture dimensions.

For now I decided to use two things:
1. I replaced wall-model with lightmapped wall-model and modified color/saturation/brightness of lightmap texture so that it fits a sort-of-wall-look :)
2. Since the only successful lightmaps I have are for floor I will make use of them once the new lightmap feature is out of beta :)
The administrator has disabled public write access.

Fake shadowmaps 8 years 3 months ago #596

  • cyberix3d
  • cyberix3d's Avatar
  • OFFLINE
  • Administrator
  • Posts: 703
  • Thank you received: 697
The lightmap feature is now available in production.
We have also added error messages to prevent the user from loading secondary lightmap model with mismatch number of UVs.

Here is a working example:
www.gamemaker3d.com/player?pid=01617001

The lightmap feature is also supported in the android version.

Regards,
Cyberix3D team
Last Edit: 8 years 3 months ago by cyberix3d.
The administrator has disabled public write access.
The following user(s) said Thank You: Ganderoleg

Fake shadowmaps 8 years 3 months ago #597

  • Ganderoleg
  • Ganderoleg's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 115
  • Thank you received: 12
Awesome news, the lightmap is functioning great with my floor model, thank you :woohoo:

I will start using simpler parts of my geometry with lightmaps (without UV mismatch).

I believe that my export process if somehow faulty, it's evident because different formats are causing different errors when imported in Away builder. But I am sure I will get it working, it's just a matter of fine-tuning the export process :)
The administrator has disabled public write access.
Time to create page: 0.123 seconds