Custom Textured part does not render correct - Printable Version +- LDraw.org Discussion Forums (https://forums.ldraw.org) +-- Forum: LDraw Programs (https://forums.ldraw.org/forum-7.html) +--- Forum: LDraw Editors and Viewers (https://forums.ldraw.org/forum-11.html) +--- Thread: Custom Textured part does not render correct (/thread-22654.html) |
Custom Textured part does not render correct - Jaco van der Molen - 2018-01-09 Hi all, I have made a custom textured part for a model. 93606p12_25_1240_150_DPCM_1_23_-45.png (Size: 10.98 KB / Downloads: 137) However it does not render correct in certain steps and orientation. See attached PDF. Does anyone have an idea why it does not render in step 2 and does in step 3 and 4? Thanks. RE: Custom Textured part does not render correct - Philippe Hurbain - 2018-01-09 (2018-01-09, 10:29)Jaco van der Molen Wrote: Does anyone have an idea why it does not render in step 2 and does in step 3 and 4?Weird. Can you share source files? RE: Custom Textured part does not render correct - Jaco van der Molen - 2018-01-09 (2018-01-09, 12:54)Philippe Hurbain Wrote:(2018-01-09, 10:29)Jaco van der Molen Wrote: Does anyone have an idea why it does not render in step 2 and does in step 3 and 4?Weird. Can you share source files? Sure. Here they are. RE: Custom Textured part does not render correct - Philippe Hurbain - 2018-01-09 (2018-01-09, 14:57)Jaco van der Molen Wrote:(2018-01-09, 12:54)Philippe Hurbain Wrote: Weird. Can you share source files? png? model file (at least the partial assembly you show in pdf)? RE: Custom Textured part does not render correct - Jaco van der Molen - 2018-01-09 (2018-01-09, 15:12)Philippe Hurbain Wrote:(2018-01-09, 14:57)Jaco van der Molen Wrote: Sure. Here they are. Oh, I attached the PNG but it got inlined. I added a zip file now with PNG, LDR and PDF. Thanks for looking in to it Philo! RE: Custom Textured part does not render correct - Philippe Hurbain - 2018-01-09 Quote:Oh, I attached the PNG but it got inlined....and I didn't notice because it was white on white background Completely puzzled by this one. I see the same kind of problem, but I find no problem in the part or model. I tried a gazillon of things and the problem remains the same (or worse!). I tried with another texmapped part (3960p0b) that works fine. And if I put 93606p12 and 3960p0b in the same file... 3960p0b is textured in all images and 93606p12 is never textured RE: Custom Textured part does not render correct - Travis Cobbs - 2018-01-10 (2018-01-09, 18:39)Jaco van der Molen Wrote:(2018-01-09, 15:12)Philippe Hurbain Wrote: png? model file (at least the partial assembly you show in pdf)? Try copying 12.png to <LDraw Dir>/Unofficial/parts/textures. RE: Custom Textured part does not render correct - Philippe Hurbain - 2018-01-10 Quote:Try copying 12.png to <LDraw Dir>/Unofficial/parts/textures.I was even more drastic and put everything in my official library in the right places, to no avail. And... how file location might explain that the texture appear in some images and not others? RE: Custom Textured part does not render correct - Jaco van der Molen - 2018-01-11 (2018-01-10, 8:32)Philippe Hurbain Wrote:Quote:Try copying 12.png to <LDraw Dir>/Unofficial/parts/textures.I was even more drastic and put everything in my official library in the right places, to no avail. And... how file location might explain that the texture appear in some images and not others? Strange isn't it. No luck here either with trial and error problem solving. Even worse: I have the same problem with another part now. This time the brick with bow 1x4. Could it be a memory problem? Is it because the PNG is white and transparent? I'll PM you the actual model Travis Cobbs or Travor Sandy (if you read this) any idea? Someone else? RE: Custom Textured part does not render correct - Philippe Hurbain - 2018-01-11 Quote:Could it be a memory problem? Is it because the PNG is white and transparent?Could have been, easy try: I reduced image size by 7 (thus 50 times less pixels) and made an orange backgound. Same problem... RE: Custom Textured part does not render correct - Travis Cobbs - 2018-01-12 (2018-01-11, 6:53)Jaco van der Molen Wrote: Travis Cobbs or Travor Sandy (if you read this) any idea? This appears to be caused by a bug in LDView. For some reason, it seems like LDView is drawing the textured geometry twice: once with the texture, and once without. Sometimes the non-textured geometry covers the texture. Sometimes I see noise where the texture is partially covered. This noise is indicative of two things being drawn in nearly the same place. I deleted the fallback geometry in your part, and that didn't fix the problem. So LDView isn't messing that up and drawing the fallback geometry. Also, while this seems to be what is happening, I can't figure out why it would be drawing that geometry twice, so I am still investigating. Also, I can't make the problem happen when I load the part all by itself. It only happens in your test model. RE: Custom Textured part does not render correct - Travis Cobbs - 2018-01-12 Hmm... I see that, more accurately, it happens in the LPub3D-generated file that is used to display the test model. LPub3D actually applies a rotation to everything in the model. And the numbers that it uses when doing that are rounded to 6 decimal places. I strongly suspect that this rounding is resulting in matrices that aren't quite right, and that factor is causing the texture mapping in LDView to not work. Trevor, is there any chance you could produce a test LPub3D that uses something silly like 15 decimal places, so we could see if that makes the problem go away? If it does, perhaps that could be a setting in LPub3D. RE: Custom Textured part does not render correct - Jaco van der Molen - 2018-01-12 (2018-01-12, 5:04)Travis Cobbs Wrote: Hmm... I see that, more accurately, it happens in the LPub3D-generated file that is used to display the test model. LPub3D actually applies a rotation to everything in the model. And the numbers that it uses when doing that are rounded to 6 decimal places. I strongly suspect that this rounding is resulting in matrices that aren't quite right, and that factor is causing the texture mapping in LDView to not work. Oh wow. This gets interesting :-) I noted too that a rotation step sometimes "fixes" the problem. Would it help to rotate the parts just a 0,1 degrees or something? Thanks for looking into it guys! RE: Custom Textured part does not render correct - Travis Cobbs - 2018-01-13 (2018-01-12, 6:35)Jaco van der Molen Wrote: Oh wow. This gets interesting :-) Probably not. Open up the cli.ldr that LPub3D creates and leaves in a tmp directory underneath the original test.ldr and spin that cli.ldr around in LDView. You will see the texture appear and disappear, but it can disappear for relatively large angle differences. Same when you zoom in and zoom out. RE: Custom Textured part does not render correct - Travis Cobbs - 2018-01-14 Turning off Primitive Substitution in LDView might make the problem go away. Turning off lighting will probably make the problem go away (but obviously change the results quite dramatically). I also may be able to send you a test version of LDView that handles textures differently that also might make the problem go away. Do you have 64-bit Windows? RE: Custom Textured part does not render correct - Philippe Hurbain - 2018-01-14 Quote:Turning off Primitive Substitution in LDView might make the problem go away. Turning off lighting will probably make the problem go away (but obviously change the results quite dramatically).Fortunately you were cautious in your terms... none of these solution seems to improve things here (no change in texture rendering). ...and I use Win7/64b RE: Custom Textured part does not render correct - Jaco van der Molen - 2018-01-14 (2018-01-14, 7:11)Travis Cobbs Wrote: Turning off Primitive Substitution in LDView might make the problem go away. Turning off lighting will probably make the problem go away (but obviously change the results quite dramatically). Ok thanks. I’ll try that. I’d appriciate your test version to try too. Might be a good test case too ? RE: Custom Textured part does not render correct - Philippe Hurbain - 2018-01-14 (2018-01-14, 15:18)Jaco van der Molen Wrote: I’d appriciate your test version to try too.64 bits Windows? |