Line list render issue
Line list render issue
Line list render issue
Line list render issue
Line list render issue
Line list render issue Line list render issue Line list render issue Line list render issue Line list render issue Line list render issue Line list render issue Line list render issue
Line list render issue Line list render issue
Line list render issue
Go Back  Xtreme Visual Basic Talk > > > > Line list render issue


Reply
 
Thread Tools Display Modes
  #1  
Old 06-16-2004, 10:42 PM
sgt_pinky's Avatar
sgt_pinky sgt_pinky is offline
Contributor
 
Join Date: Feb 2004
Location: Melbourne, Australia
Posts: 633
Default Line list render issue


Hey,

I am rendering trias in red, and then drawing a line list over the top in black, to outline the trias.

Problem is, at some angles, the black lines look really dodgy. Is there anyway I can give them precedence over the trias?

See attached screenshot Screenshot Here

This is my render sub:

Code:
Code:
dRender.Clear(ClearFlags.Target Or ClearFlags.ZBuffer, System.Drawing.Color.LightGray, 1.0F, 0) dRender.BeginScene() Call SetupView() dRender.SetStreamSource(0, vertexBuffer, 0) dRender.VertexFormat = CustomVertex.PositionNormalColored.Format dRender.DrawPrimitives(PrimitiveType.TriangleList, 0, lTrias_num) dRender.DrawPrimitives(PrimitiveType.LineList, lTrias_num * 3, lLines_num) dRender.EndScene() dRender.Present()
Attached Images
File Type: jpg Image1.jpg (38.2 KB, 19 views)
Reply With Quote
  #2  
Old 06-25-2004, 01:01 AM
sgt_pinky's Avatar
sgt_pinky sgt_pinky is offline
Contributor
 
Join Date: Feb 2004
Location: Melbourne, Australia
Posts: 633
Default

I have narrowed it down to the Z-buffer test. I can't work out the right combination and order to render the lines though. I have set different DepthBias when rendering the polys and lines, but I can't seem to get it to work properly. I have also tried combinations of Z-Functions, but still couldn't find the right combination.

If anyone can help, it would be greatly appreciated!
Reply With Quote
  #3  
Old 07-06-2004, 12:23 AM
createdbyx createdbyx is offline
Freshman
 
Join Date: Mar 2004
Posts: 25
Default

Have you tried just turning off the zbuffer, rendering your lines, then turning the zbuffer back on?

Device.RenderState.ZBufferEnable=False
' render your lines
Device.RenderState.ZBufferEnable=True
__________________
Created by: X
createdbyx@gmail.com
www.createdbyx.com
Reply With Quote
  #4  
Old 07-06-2004, 12:44 AM
sgt_pinky's Avatar
sgt_pinky sgt_pinky is offline
Contributor
 
Join Date: Feb 2004
Location: Melbourne, Australia
Posts: 633
Default

Cheers for your reply mate. I didnt try that but I just solved my problem anyway!!!

After a week of getting nowhere on this issue, I solved it with the following:

1. Set RenderState.ZBufferEnable = True
2. Set RenderState.ZBufferFunction = Compare.LessEqual
3. Set RenderState.DepthBias = 0
4. Set RenderState.SlopeScaleDepthBias = 1
5. Render the lines
6. Set RenderState.DepthBias = 1
7. Set RenderState.SlopeScaleDepthBias = 1
8. Render the tria's

Man, thank god for that. It was really starting to tick me off!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Line list render issue
Line list render issue
Line list render issue Line list render issue
Line list render issue
Line list render issue
Line list render issue Line list render issue Line list render issue Line list render issue Line list render issue Line list render issue Line list render issue
Line list render issue
Line list render issue
 
Line list render issue
Line list render issue
 
-->